[gthumb] added navigation buttons to show the next and the previous image



commit 414134bcde3dfdc56e140e3160d2bc11083390e8
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Apr 30 18:52:02 2014 +0200

    added navigation buttons to show the next and the previous image

 extensions/gstreamer_tools/gth-media-viewer-page.c |    3 +
 extensions/image_viewer/gth-image-viewer-page.c    |  156 ++++++++++---------
 gthumb/gth-browser-actions-callbacks.c             |   19 +++
 gthumb/gth-browser-actions-callbacks.h             |    2 +
 gthumb/gth-browser-actions-entries.h               |    3 +
 gthumb/gth-browser.c                               |  159 ++++++++++++++++----
 6 files changed, 237 insertions(+), 105 deletions(-)
---
diff --git a/extensions/gstreamer_tools/gth-media-viewer-page.c 
b/extensions/gstreamer_tools/gth-media-viewer-page.c
index ef7601b..aa859fb 100644
--- a/extensions/gstreamer_tools/gth-media-viewer-page.c
+++ b/extensions/gstreamer_tools/gth-media-viewer-page.c
@@ -1121,6 +1121,9 @@ gth_media_viewer_page_real_show_pointer (GthViewerPage *base,
 {
        GthMediaViewerPage *self = (GthMediaViewerPage*) base;
 
+       if (show == self->priv->cursor_visible)
+               return;
+
        self->priv->cursor_visible = show;
 
        if (show && (self->priv->cursor != NULL))
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 5e14624..5a6c17d 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -32,6 +32,7 @@
 #define UPDATE_VISIBILITY_DELAY 100
 #define N_HEADER_BAR_BUTTONS 2
 #define HIDE_OVERVIEW_TIMEOUT 2 /* in seconds */
+#define OVERLAY_MARGIN 10
 
 
 static void gth_viewer_page_interface_init (GthViewerPageInterface *iface);
@@ -352,8 +353,10 @@ hide_overview_after_timeout (gpointer data)
                g_source_remove (self->priv->hide_overview_id);
        self->priv->hide_overview_id = 0;
 
-       if (! self->priv->pointer_on_overview)
-               gtk_revealer_set_reveal_child (GTK_REVEALER (self->priv->overview_revealer), FALSE);
+       if (! self->priv->pointer_on_overview) {
+               if (gtk_revealer_get_child_revealed (GTK_REVEALER (self->priv->overview_revealer)))
+                       gtk_revealer_set_reveal_child (GTK_REVEALER (self->priv->overview_revealer), FALSE);
+       }
 
        return FALSE;
 }
@@ -363,7 +366,7 @@ static gboolean
 update_overview_visibility_now (gpointer user_data)
 {
        GthImageViewerPage *self;
-       gboolean            visible;
+       gboolean            overview_visible;
        gboolean            revealed;
 
        self = GTH_IMAGE_VIEWER_PAGE (user_data);
@@ -375,14 +378,13 @@ update_overview_visibility_now (gpointer user_data)
                self->priv->update_visibility_id = 0;
        }
 
-       visible = self->priv->pointer_on_overview || (self->priv->pointer_on_viewer && 
gth_image_viewer_has_scrollbars (GTH_IMAGE_VIEWER (self->priv->viewer)));
-       gtk_revealer_set_reveal_child (GTK_REVEALER (self->priv->overview_revealer), visible);
+       overview_visible = self->priv->pointer_on_overview || (self->priv->pointer_on_viewer && 
gth_image_viewer_has_scrollbars (GTH_IMAGE_VIEWER (self->priv->viewer)));
+       gtk_revealer_set_reveal_child (GTK_REVEALER (self->priv->overview_revealer), overview_visible);
 
-       if (visible) {
+       if (overview_visible) {
                if (self->priv->hide_overview_id != 0)
                        g_source_remove (self->priv->hide_overview_id);
                self->priv->hide_overview_id = g_timeout_add_seconds (HIDE_OVERVIEW_TIMEOUT, 
hide_overview_after_timeout, self);
-
        }
 
        return FALSE;
@@ -452,39 +454,6 @@ viewer_button_press_event_cb (GtkWidget          *widget,
 
 
 static gboolean
-viewer_motion_notify_event_cb (GtkWidget      *widget,
-                              GdkEventMotion *event,
-                              gpointer        data)
-{
-       GthImageViewerPage *self = data;
-
-       if (self->priv->hide_overview_id != 0) {
-               g_source_remove (self->priv->hide_overview_id);
-               self->priv->hide_overview_id = 0;
-       }
-
-       self->priv->pointer_on_overview = (widget == self->priv->overview);
-       update_overview_visibility (data);
-
-       return FALSE;
-}
-
-
-static gboolean
-viewer_leave_notify_event_cb (GtkWidget *widget,
-                             GdkEvent  *event,
-                             gpointer   data)
-{
-       GthImageViewerPage *self = data;
-
-       self->priv->pointer_on_overview = FALSE;
-       update_overview_visibility (data);
-
-       return FALSE;
-}
-
-
-static gboolean
 viewer_popup_menu_cb (GtkWidget          *widget,
                      GthImageViewerPage *self)
 {
@@ -594,6 +563,65 @@ viewer_unrealize_cb (GtkWidget *widget,
 }
 
 
+static gboolean
+image_navigator_get_child_position_cb  (GtkOverlay   *overlay,
+                                        GtkWidget    *widget,
+                                        GdkRectangle *allocation,
+                                        gpointer      user_data)
+{
+       GthImageViewerPage *self = GTH_IMAGE_VIEWER_PAGE (user_data);
+       GtkAllocation       main_alloc;
+       gboolean            allocation_filled = FALSE;
+
+       gtk_widget_get_allocation (gtk_bin_get_child (GTK_BIN (overlay)), &main_alloc);
+       gtk_widget_get_preferred_width (widget, NULL, &allocation->width);
+       gtk_widget_get_preferred_height (widget, NULL, &allocation->height);
+
+       if (widget == self->priv->overview_revealer) {
+               allocation->x = main_alloc.width - allocation->width - OVERLAY_MARGIN;
+               allocation->y = OVERLAY_MARGIN;
+               allocation_filled = TRUE;
+       }
+
+       return allocation_filled;
+}
+
+
+static gboolean
+overview_motion_notify_event_cb (GtkWidget      *widget,
+                                GdkEventMotion *event,
+                                gpointer        data)
+{
+       GthImageViewerPage *self = data;
+
+       if (self->priv->hide_overview_id != 0) {
+               g_source_remove (self->priv->hide_overview_id);
+               self->priv->hide_overview_id = 0;
+       }
+
+       self->priv->pointer_on_viewer = TRUE;
+       if (widget == self->priv->overview)
+               self->priv->pointer_on_overview = TRUE;
+       update_overview_visibility (data);
+
+       return FALSE;
+}
+
+
+static gboolean
+overview_leave_notify_event_cb (GtkWidget *widget,
+                               GdkEvent  *event,
+                               gpointer   data)
+{
+       GthImageViewerPage *self = data;
+
+       if (widget == self->priv->overview)
+               self->priv->pointer_on_overview = FALSE;
+
+       return FALSE;
+}
+
+
 static void
 pref_zoom_quality_changed (GSettings *settings,
                           char      *key,
@@ -778,30 +806,6 @@ paint_comment_over_image_func (GthImageViewer *image_viewer,
 }
 
 
-static gboolean
-image_navigator_get_child_position_cb  (GtkOverlay   *overlay,
-                                        GtkWidget    *widget,
-                                        GdkRectangle *allocation,
-                                        gpointer      user_data)
-{
-       GthImageViewerPage *self = GTH_IMAGE_VIEWER_PAGE (user_data);
-
-       if (widget == self->priv->overview_revealer) {
-               GtkAllocation main_alloc;
-
-               gtk_widget_get_allocation (gtk_bin_get_child (GTK_BIN (overlay)), &main_alloc);
-               gtk_widget_get_preferred_width (widget, NULL, &allocation->width);
-               gtk_widget_get_preferred_height (widget, NULL, &allocation->height);
-               allocation->x = main_alloc.width - allocation->width - 10;
-               allocation->y = 10;
-
-               return TRUE;
-       }
-
-       return FALSE;
-}
-
-
 static void
 gth_image_viewer_page_real_activate (GthViewerPage *base,
                                     GthBrowser    *browser)
@@ -857,14 +861,6 @@ gth_image_viewer_page_real_activate (GthViewerPage *base,
                                G_CALLBACK (viewer_button_press_event_cb),
                                self);
        g_signal_connect_after (G_OBJECT (self->priv->viewer),
-                               "motion-notify-event",
-                               G_CALLBACK (viewer_motion_notify_event_cb),
-                               self);
-       g_signal_connect_after (G_OBJECT (self->priv->viewer),
-                               "leave-notify-event",
-                               G_CALLBACK (viewer_leave_notify_event_cb),
-                               self);
-       g_signal_connect_after (G_OBJECT (self->priv->viewer),
                                "scroll_event",
                                G_CALLBACK (viewer_scroll_event_cb),
                                self);
@@ -900,13 +896,17 @@ gth_image_viewer_page_real_activate (GthViewerPage *base,
        gtk_overlay_add_overlay (GTK_OVERLAY (self->priv->image_navigator), self->priv->overview_revealer);
 
        self->priv->overview = gth_image_overview_new (GTH_IMAGE_VIEWER (self->priv->viewer));
-       gtk_widget_add_events (self->priv->overview, GDK_POINTER_MOTION_HINT_MASK);
+       gtk_widget_add_events (self->priv->overview, GDK_POINTER_MOTION_HINT_MASK | GDK_LEAVE_NOTIFY_MASK);
        gtk_widget_show (self->priv->overview);
        gtk_container_add (GTK_CONTAINER (self->priv->overview_revealer), self->priv->overview);
 
        g_signal_connect_after (G_OBJECT (self->priv->overview),
                                "motion-notify-event",
-                               G_CALLBACK (viewer_motion_notify_event_cb),
+                               G_CALLBACK (overview_motion_notify_event_cb),
+                               self);
+       g_signal_connect_after (G_OBJECT (self->priv->overview),
+                               "leave-notify-event",
+                               G_CALLBACK (overview_leave_notify_event_cb),
                                self);
 
        gth_browser_set_viewer_widget (browser, self->priv->image_navigator);
@@ -1202,6 +1202,14 @@ gth_image_viewer_page_real_show_pointer (GthViewerPage *base,
                gth_image_viewer_show_cursor (GTH_IMAGE_VIEWER (self->priv->viewer));
        else if (gth_browser_get_is_fullscreen (self->priv->browser))
                gth_image_viewer_hide_cursor (GTH_IMAGE_VIEWER (self->priv->viewer));
+
+       if (self->priv->hide_overview_id != 0) {
+               g_source_remove (self->priv->hide_overview_id);
+               self->priv->hide_overview_id = 0;
+       }
+
+       self->priv->pointer_on_viewer = show;
+       update_overview_visibility (self);
 }
 
 
diff --git a/gthumb/gth-browser-actions-callbacks.c b/gthumb/gth-browser-actions-callbacks.c
index 58ee2be..538b72c 100644
--- a/gthumb/gth-browser-actions-callbacks.c
+++ b/gthumb/gth-browser-actions-callbacks.c
@@ -519,3 +519,22 @@ gth_browser_activate_show_thumbnail_list (GSimpleAction *action,
        g_settings_set_boolean (settings, PREF_BROWSER_THUMBNAIL_LIST_VISIBLE, g_variant_get_boolean (state));
        g_object_unref (settings);
 }
+
+
+void
+gth_browser_activate_show_previous_image (GSimpleAction *action,
+                                         GVariant      *state,
+                                         gpointer       user_data)
+{
+       GthBrowser *browser = GTH_BROWSER (user_data);
+       gth_browser_show_prev_image (browser, FALSE, FALSE);
+}
+
+void
+gth_browser_activate_show_next_image (GSimpleAction *action,
+                                     GVariant      *state,
+                                     gpointer       user_data)
+{
+       GthBrowser *browser = GTH_BROWSER (user_data);
+       gth_browser_show_next_image (browser, FALSE, FALSE);
+}
diff --git a/gthumb/gth-browser-actions-callbacks.h b/gthumb/gth-browser-actions-callbacks.h
index 720e95b..ef5c478 100644
--- a/gthumb/gth-browser-actions-callbacks.h
+++ b/gthumb/gth-browser-actions-callbacks.h
@@ -58,5 +58,7 @@ DEF_ACTION_CALLBACK (gth_browser_activate_sort_by)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_statusbar)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_sidebar)
 DEF_ACTION_CALLBACK (gth_browser_activate_show_thumbnail_list)
+DEF_ACTION_CALLBACK (gth_browser_activate_show_previous_image)
+DEF_ACTION_CALLBACK (gth_browser_activate_show_next_image)
 
 #endif /* GTH_BROWSER_ACTIONS_CALLBACK_H */
diff --git a/gthumb/gth-browser-actions-entries.h b/gthumb/gth-browser-actions-entries.h
index 1df6793..0339878 100644
--- a/gthumb/gth-browser-actions-entries.h
+++ b/gthumb/gth-browser-actions-entries.h
@@ -56,6 +56,9 @@ static const GActionEntry gth_browser_actions[] = {
        { "show-statusbar", toggle_action_activated, NULL, "false", gth_browser_activate_show_statusbar },
        { "show-sidebar", toggle_action_activated, NULL, "false", gth_browser_activate_show_sidebar },
        { "show-thumbnail-list", toggle_action_activated, NULL, "false", 
gth_browser_activate_show_thumbnail_list },
+
+       { "show-previous-image", gth_browser_activate_show_previous_image },
+       { "show-next-image", gth_browser_activate_show_next_image },
 };
 
 
diff --git a/gthumb/gth-browser.c b/gthumb/gth-browser.c
index 16bb371..6e51d68 100644
--- a/gthumb/gth-browser.c
+++ b/gthumb/gth-browser.c
@@ -62,7 +62,7 @@
 #define MAX_HISTORY_LENGTH 15
 #define LOAD_FILE_DELAY 150
 #define LOAD_METADATA_DELAY 150
-#define HIDE_MOUSE_DELAY 3000
+#define HIDE_MOUSE_DELAY 2 /* in seconds */
 #define MOTION_THRESHOLD 0
 #define UPDATE_SELECTION_DELAY 200
 #define MIN_SIDEBAR_SIZE 100
@@ -73,6 +73,7 @@
 #define FILE_PROPERTIES_MINIMUM_HEIGHT 100
 #define HISTORY_FILE "history.xbel"
 #define SECTION_BIG_MARGIN 12
+#define OVERLAY_MARGIN 10
 
 
 G_DEFINE_TYPE (GthBrowser, gth_browser, GTH_TYPE_WINDOW)
@@ -187,7 +188,10 @@ struct _GthBrowserPrivate {
        gboolean           fullscreen;
        gboolean           was_fullscreen;
        GtkWidget         *fullscreen_toolbar;
+       GtkWidget         *next_image_button;
+       GtkWidget         *previous_image_button;
        GList             *viewer_controls;
+       GList             *fixed_viewer_controls;
        gboolean           pointer_visible;
        guint              hide_mouse_timeout;
        guint              motion_signal;
@@ -2214,42 +2218,65 @@ typedef struct {
 
 
 static gboolean
+pointer_on_widget (GtkWidget *widget,
+                  GdkDevice *device)
+{
+       GdkWindow *widget_win;
+       int        px, py, w, h;
+
+       if (! gtk_widget_get_visible (widget) || ! gtk_widget_get_realized (widget))
+               return FALSE;
+
+       widget_win = gtk_widget_get_window (widget);
+       gdk_window_get_device_position (widget_win,
+                                       device,
+                                       &px,
+                                       &py,
+                                       0);
+       w = gdk_window_get_width (widget_win);
+       h = gdk_window_get_height (widget_win);
+
+       return ((px >= 0) && (px <= w) && (py >= 0) && (py <= h));
+}
+
+
+static gboolean
+pointer_on_control (HideMouseData *hmdata,
+                   GList         *controls)
+{
+       GList *scan;
+
+       for (scan = controls; scan; scan = scan->next)
+               if (pointer_on_widget ((GtkWidget *) scan->data, hmdata->device))
+                       return TRUE;
+
+       return FALSE;
+}
+
+
+static gboolean
 hide_mouse_pointer_cb (gpointer data)
 {
        HideMouseData *hmdata = data;
        GthBrowser    *browser = hmdata->browser;
        GList         *scan;
 
-       /* do not hide the pointer if it's over a viewer control */
-
-       for (scan = browser->priv->viewer_controls; scan; scan = scan->next) {
-               GtkWidget *widget = scan->data;
-               GdkWindow *widget_win;
-               int        px, py, w, h;
-
-               if (! gtk_widget_get_visible (widget) || ! gtk_widget_get_realized (widget))
-                       continue;
+       browser->priv->hide_mouse_timeout = 0;
 
-               widget_win = gtk_widget_get_window (widget);
-               gdk_window_get_device_position (widget_win,
-                                               hmdata->device,
-                                               &px,
-                                               &py,
-                                               0);
-               w = gdk_window_get_width (widget_win);
-               h = gdk_window_get_height (widget_win);
+       /* do not hide the pointer if it's over a viewer control */
 
-               if ((px >= 0) && (px <= w) && (py >= 0) && (py <= h))
-                       return FALSE;
+       if (pointer_on_control (hmdata, browser->priv->fixed_viewer_controls)
+           || pointer_on_control (hmdata, browser->priv->viewer_controls))
+       {
+               return FALSE;
        }
 
        browser->priv->pointer_visible = FALSE;
        gtk_widget_hide (browser->priv->fullscreen_toolbar);
+       g_list_foreach (browser->priv->fixed_viewer_controls, (GFunc) gtk_widget_hide, NULL);
        if (browser->priv->viewer_page != NULL)
                _gth_browser_show_pointer_on_viewer (browser, FALSE);
 
-       browser->priv->hide_mouse_timeout = 0;
-
        return FALSE;
 }
 
@@ -2262,6 +2289,9 @@ viewer_motion_notify_event_cb (GtkWidget      *widget,
        GthBrowser    *browser = data;
        HideMouseData *hmdata;
 
+       if (! pointer_on_widget (browser->priv->viewer_container, event->device))
+               return FALSE;
+
        if (browser->priv->last_mouse_x == 0.0)
                browser->priv->last_mouse_x = event->x;
        if (browser->priv->last_mouse_y == 0.0)
@@ -2274,9 +2304,10 @@ viewer_motion_notify_event_cb (GtkWidget      *widget,
                        browser->priv->pointer_visible = TRUE;
                        if (browser->priv->fullscreen)
                                gtk_widget_show (browser->priv->fullscreen_toolbar);
-                       if (browser->priv->viewer_page != NULL)
-                               _gth_browser_show_pointer_on_viewer (browser, TRUE);
+                       g_list_foreach (browser->priv->fixed_viewer_controls, (GFunc) gtk_widget_show, NULL);
                }
+               if (browser->priv->viewer_page != NULL)
+                       _gth_browser_show_pointer_on_viewer (browser, TRUE);
        }
 
        if (browser->priv->hide_mouse_timeout != 0)
@@ -2285,11 +2316,11 @@ viewer_motion_notify_event_cb (GtkWidget      *widget,
        hmdata = g_new0 (HideMouseData, 1);
        hmdata->browser = browser;
        hmdata->device = event->device;
-       browser->priv->hide_mouse_timeout = g_timeout_add_full (G_PRIORITY_DEFAULT,
-                                                               HIDE_MOUSE_DELAY,
-                                                               hide_mouse_pointer_cb,
-                                                               hmdata,
-                                                               g_free);
+       browser->priv->hide_mouse_timeout = g_timeout_add_seconds_full (G_PRIORITY_DEFAULT,
+                                                                       HIDE_MOUSE_DELAY,
+                                                                       hide_mouse_pointer_cb,
+                                                                       hmdata,
+                                                                       g_free);
 
        browser->priv->last_mouse_x = event->x;
        browser->priv->last_mouse_y = event->y;
@@ -2522,6 +2553,40 @@ gth_browser_class_init (GthBrowserClass *klass)
 }
 
 
+static gboolean
+viewer_container_get_child_position_cb (GtkOverlay   *overlay,
+                                       GtkWidget    *widget,
+                                       GdkRectangle *allocation,
+                                       gpointer      user_data)
+{
+       GthBrowser     *browser = user_data;
+       GtkAllocation   main_alloc;
+       gboolean        allocation_filled = FALSE;
+
+       gtk_widget_get_allocation (gtk_bin_get_child (GTK_BIN (overlay)), &main_alloc);
+       gtk_widget_get_preferred_width (widget, NULL, &allocation->width);
+       gtk_widget_get_preferred_height (widget, NULL, &allocation->height);
+
+       if (widget == browser->priv->fullscreen_toolbar) {
+               allocation->x = 0;
+               allocation->y = 0;
+               allocation_filled = TRUE;
+       }
+       else if (widget == browser->priv->previous_image_button) {
+               allocation->x = OVERLAY_MARGIN;
+               allocation->y = (main_alloc.height - allocation->height) / 2;
+               allocation_filled = TRUE;
+       }
+       else if (widget == browser->priv->next_image_button) {
+               allocation->x = main_alloc.width - allocation->width - OVERLAY_MARGIN;
+               allocation->y = (main_alloc.height - allocation->height) / 2;
+               allocation_filled = TRUE;
+       }
+
+       return allocation_filled;
+}
+
+
 static void
 folder_tree_drag_data_received (GtkWidget        *tree_view,
                                GdkDragContext   *context,
@@ -3873,6 +3938,14 @@ _gth_browser_unrealize (GtkWidget *browser,
 
 
 static void
+_gth_browser_register_fixed_viewer_control (GthBrowser *browser,
+                                           GtkWidget  *widget)
+{
+       browser->priv->fixed_viewer_controls = g_list_prepend (browser->priv->fixed_viewer_controls, widget);
+}
+
+
+static void
 gth_browser_init (GthBrowser *browser)
 {
        int             window_width;
@@ -3931,6 +4004,7 @@ gth_browser_init (GthBrowser *browser)
        browser->priv->fullscreen = FALSE;
        browser->priv->was_fullscreen = FALSE;
        browser->priv->viewer_controls = NULL;
+       browser->priv->fixed_viewer_controls = NULL;
        browser->priv->pointer_visible = TRUE;
        browser->priv->hide_mouse_timeout = 0;
        browser->priv->motion_signal = 0;
@@ -4024,6 +4098,11 @@ gth_browser_init (GthBrowser *browser)
        gtk_widget_set_size_request (browser->priv->viewer_container, MIN_VIEWER_SIZE, -1);
        gtk_widget_show (browser->priv->viewer_container);
 
+       g_signal_connect (browser->priv->viewer_container,
+                         "get-child-position",
+                         G_CALLBACK (viewer_container_get_child_position_cb),
+                         browser);
+
        gtk_paned_pack1 (GTK_PANED (browser->priv->viewer_sidebar_pane), browser->priv->viewer_container, 
TRUE, FALSE);
        browser->priv->viewer_sidebar_alignment = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
        gth_paned_set_position2 (GTH_PANED (browser->priv->viewer_sidebar_pane), g_settings_get_int 
(browser->priv->browser_settings, PREF_BROWSER_BROWSER_SIDEBAR_WIDTH));
@@ -4196,16 +4275,34 @@ gth_browser_init (GthBrowser *browser)
                GtkWidget *button;
 
                browser->priv->fullscreen_toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
-               gtk_widget_set_halign (browser->priv->fullscreen_toolbar, GTK_ALIGN_START);
-               gtk_widget_set_valign (browser->priv->fullscreen_toolbar, GTK_ALIGN_START);
                gtk_overlay_add_overlay (GTK_OVERLAY (browser->priv->viewer_container), 
browser->priv->fullscreen_toolbar);
 
                button = gtk_button_new_from_icon_name ("view-restore-symbolic", GTK_ICON_SIZE_BUTTON);
                gtk_actionable_set_action_name (GTK_ACTIONABLE (button), "win.unfullscreen");
+               gtk_style_context_add_class (gtk_widget_get_style_context (button), GTK_STYLE_CLASS_OSD);
                gtk_widget_show (button);
                gtk_box_pack_start (GTK_BOX (browser->priv->fullscreen_toolbar), button, FALSE, FALSE, 0);
        }
 
+       /* overlay commands */
+
+       {
+               /* show next image */
+
+               browser->priv->next_image_button = gtk_button_new_from_icon_name ("go-next-symbolic", 
GTK_ICON_SIZE_BUTTON);
+               gtk_actionable_set_action_name (GTK_ACTIONABLE (browser->priv->next_image_button), 
"win.show-next-image");
+               gtk_style_context_add_class (gtk_widget_get_style_context (browser->priv->next_image_button), 
GTK_STYLE_CLASS_OSD);
+               gtk_overlay_add_overlay (GTK_OVERLAY (browser->priv->viewer_container), 
browser->priv->next_image_button);
+               _gth_browser_register_fixed_viewer_control (browser, browser->priv->next_image_button);
+
+               /* show previous image */
+
+               browser->priv->previous_image_button = gtk_button_new_from_icon_name ("go-previous-symbolic", 
GTK_ICON_SIZE_BUTTON);
+               gtk_actionable_set_action_name (GTK_ACTIONABLE (browser->priv->previous_image_button), 
"win.show-previous-image");
+               gtk_style_context_add_class (gtk_widget_get_style_context 
(browser->priv->previous_image_button), GTK_STYLE_CLASS_OSD);
+               gtk_overlay_add_overlay (GTK_OVERLAY (browser->priv->viewer_container), 
browser->priv->previous_image_button);
+               _gth_browser_register_fixed_viewer_control (browser, browser->priv->previous_image_button);
+       }
 
        /* infobar */
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]