[gnome-photos/wip/rishi/zoom: 5/11] preview-nav-buttons, preview-view: Allow disabling navigation buttons
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/zoom: 5/11] preview-nav-buttons, preview-view: Allow disabling navigation buttons
- Date: Sun, 18 Jun 2017 12:21:46 +0000 (UTC)
commit 84bf6855de34122e5545e3ced5779f809adc4d46
Author: Debarshi Ray <debarshir gnome org>
Date: Wed Jun 14 20:42:48 2017 +0200
preview-nav-buttons, preview-view: Allow disabling navigation buttons
A subsequent commit will use this to disable the next and previous
buttons when an item is zoomed in.
https://bugzilla.gnome.org/show_bug.cgi?id=742662
src/photos-preview-nav-buttons.c | 18 ++++++++++++++++--
src/photos-preview-nav-buttons.h | 3 +++
src/photos-preview-view.c | 2 ++
3 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-preview-nav-buttons.c b/src/photos-preview-nav-buttons.c
index b22c7d9..b8fbda0 100644
--- a/src/photos-preview-nav-buttons.c
+++ b/src/photos-preview-nav-buttons.c
@@ -54,6 +54,7 @@ struct _PhotosPreviewNavButtons
PhotosWindowMode old_mode;
gboolean enable_next;
gboolean enable_prev;
+ gboolean show_navigation;
gboolean visible;
gboolean visible_internal;
guint auto_hide_id;
@@ -219,12 +220,12 @@ photos_preview_nav_buttons_update_visibility (PhotosPreviewNavButtons *self)
if (item == NULL || !self->visible)
enable_zoom = FALSE;
- if (self->visible_internal && self->enable_next)
+ if (self->visible_internal && self->show_navigation && self->enable_next)
photos_preview_nav_buttons_fade_in_button (self, self->next_widget);
else
photos_preview_nav_buttons_fade_out_button (self, self->next_widget);
- if (self->visible_internal && self->enable_prev)
+ if (self->visible_internal && self->show_navigation && self->enable_prev)
photos_preview_nav_buttons_fade_in_button (self, self->prev_widget);
else
photos_preview_nav_buttons_fade_out_button (self, self->prev_widget);
@@ -677,6 +678,19 @@ photos_preview_nav_buttons_set_mode (PhotosPreviewNavButtons *self, PhotosWindow
void
+photos_preview_nav_buttons_set_show_navigation (PhotosPreviewNavButtons *self, gboolean show_navigation)
+{
+ g_return_if_fail (PHOTOS_IS_PREVIEW_NAV_BUTTONS (self));
+
+ if (self->show_navigation == show_navigation)
+ return;
+
+ self->show_navigation = show_navigation;
+ photos_preview_nav_buttons_update_visibility (self);
+}
+
+
+void
photos_preview_nav_buttons_show (PhotosPreviewNavButtons *self)
{
g_return_if_fail (PHOTOS_IS_PREVIEW_NAV_BUTTONS (self));
diff --git a/src/photos-preview-nav-buttons.h b/src/photos-preview-nav-buttons.h
index 986c7e8..128c286 100644
--- a/src/photos-preview-nav-buttons.h
+++ b/src/photos-preview-nav-buttons.h
@@ -44,6 +44,9 @@ void photos_preview_nav_buttons_hide (Photo
void photos_preview_nav_buttons_set_mode (PhotosPreviewNavButtons *self,
PhotosWindowMode old_mode);
+void photos_preview_nav_buttons_set_show_navigation (PhotosPreviewNavButtons *self,
+ gboolean show_navigation);
+
void photos_preview_nav_buttons_show (PhotosPreviewNavButtons *self);
G_END_DECLS
diff --git a/src/photos-preview-view.c b/src/photos-preview-view.c
index 8b37a42..d814d9e 100644
--- a/src/photos-preview-view.c
+++ b/src/photos-preview-view.c
@@ -826,6 +826,7 @@ photos_preview_view_window_mode_changed (PhotosPreviewView *self, PhotosWindowMo
case PHOTOS_WINDOW_MODE_PREVIEW:
gtk_revealer_set_reveal_child (GTK_REVEALER (self->revealer), FALSE);
photos_edit_palette_hide_details (PHOTOS_EDIT_PALETTE (self->palette));
+ photos_preview_nav_buttons_set_show_navigation (self->nav_buttons, TRUE);
photos_preview_nav_buttons_show (self->nav_buttons);
break;
@@ -1151,6 +1152,7 @@ photos_preview_view_set_mode (PhotosPreviewView *self, PhotosWindowMode old_mode
g_return_if_fail (old_mode != PHOTOS_WINDOW_MODE_PREVIEW);
photos_preview_nav_buttons_set_mode (self->nav_buttons, old_mode);
+ photos_preview_nav_buttons_set_show_navigation (self->nav_buttons, TRUE);
photos_preview_nav_buttons_show (self->nav_buttons);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]