From d901af03035620e2c958f4d7a6eededfa0bce8af Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Wed, 31 May 2017 11:56:38 +0100 Subject: [PATCH] Fix #488: Issues using Geeqie to compare pictures https://github.com/BestImageViewer/geeqie/issues/488 Part 3: Use alt+left/right arrow keys to move between split window panes --- .../GuideReferenceKeyboardShortcuts.xml | 35 +++++++++++++++ src/layout_util.c | 45 +++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/doc/docbook/GuideReferenceKeyboardShortcuts.xml b/doc/docbook/GuideReferenceKeyboardShortcuts.xml index eb9bec87..a07aa97b 100644 --- a/doc/docbook/GuideReferenceKeyboardShortcuts.xml +++ b/doc/docbook/GuideReferenceKeyboardShortcuts.xml @@ -667,6 +667,41 @@ Toggle slideshow. + + + E + + + Split panes horizontal. + + + + U + + + Split panes vertical. + + + + Y + + + Single pane. + + + + Alt + Right Arrow + + + Next split pane. + + + + Alt + Left Arrow + + + Previous split pane. + diff --git a/src/layout_util.c b/src/layout_util.c index 5616fc05..ffc5d6ce 100644 --- a/src/layout_util.c +++ b/src/layout_util.c @@ -1227,6 +1227,46 @@ static void layout_menu_image_next_cb(GtkAction *action, gpointer data) layout_image_next(lw); } +static void layout_menu_split_pane_next_cb(GtkAction *action, gpointer data) +{ + LayoutWindow *lw = data; + gint active_frame; + + active_frame = lw->active_split_image; + + if (active_frame < MAX_SPLIT_IMAGES-1 && lw->split_images[active_frame+1] ) + { + active_frame++; + } + else + { + active_frame = 0; + } + layout_image_activate(lw, active_frame, FALSE); +} + +static void layout_menu_split_pane_prev_cb(GtkAction *action, gpointer data) +{ + LayoutWindow *lw = data; + gint active_frame; + + active_frame = lw->active_split_image; + + if (active_frame >=1 && lw->split_images[active_frame-1] ) + { + active_frame--; + } + else + { + active_frame = MAX_SPLIT_IMAGES-1; + while (!lw->split_images[active_frame]) + { + active_frame--; + } + } + layout_image_activate(lw, active_frame, FALSE); +} + static void layout_menu_image_last_cb(GtkAction *action, gpointer data) { LayoutWindow *lw = data; @@ -1595,6 +1635,8 @@ static GtkActionEntry menu_entries[] = { { "LogWindow", NULL, N_("_Log Window"), NULL, N_("Log Window"), CB(layout_menu_log_window_cb) }, { "ExifWin", NULL, N_("_Exif window"), "E", N_("Exif window"), CB(layout_menu_bar_exif_cb) }, { "StereoCycle", NULL, N_("_Cycle through stereo modes"), NULL, N_("Cycle through stereo modes"), CB(layout_menu_stereo_mode_next_cb) }, + { "SplitNextPane", NULL, N_("_Next Pane"), "Right", N_("Next Pane"), CB(layout_menu_split_pane_next_cb) }, + { "SplitPreviousPane", NULL, N_("_Previous Pane"), "Left", N_("Previous Pane"), CB(layout_menu_split_pane_prev_cb) }, }; @@ -1803,6 +1845,9 @@ static const gchar *menu_ui_description = " " " " " " +" " +" " +" " " " " " " " -- 2.20.1