changeset 2493:678ae40bac9e

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
author Colin Clark <colin.clark@cclark.uk>
date Wed, 31 May 2017 11:56:38 +0100
parents 586556259c35
children e5625bd7524d
files doc/docbook/GuideReferenceKeyboardShortcuts.xml src/layout_util.c
diffstat 2 files changed, 80 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/docbook/GuideReferenceKeyboardShortcuts.xml	Wed May 31 09:01:35 2017 +0100
+++ b/doc/docbook/GuideReferenceKeyboardShortcuts.xml	Wed May 31 11:56:38 2017 +0100
@@ -667,6 +667,41 @@
             <entry />
             <entry>Toggle slideshow.</entry>
           </row>
+          <row>
+            <entry>
+              <keycap>E</keycap>
+            </entry>
+            <entry />
+            <entry>Split panes horizontal.</entry>
+          </row>
+          <row>
+            <entry>
+              <keycap>U</keycap>
+            </entry>
+            <entry />
+            <entry>Split panes vertical.</entry>
+          </row>
+          <row>
+            <entry>
+              <keycap>Y</keycap>
+            </entry>
+            <entry />
+            <entry>Single pane.</entry>
+          </row>
+          <row>
+            <entry>
+              <code>Alt + Right Arrow</code>
+            </entry>
+            <entry />
+            <entry>Next split pane.</entry>
+          </row>
+          <row>
+            <entry>
+              <code>Alt + Left Arrow</code>
+            </entry>
+            <entry />
+            <entry>Previous split pane.</entry>
+          </row>
         </tbody>
       </tgroup>
     </table>
--- a/src/layout_util.c	Wed May 31 09:01:35 2017 +0100
+++ b/src/layout_util.c	Wed May 31 11:56:38 2017 +0100
@@ -1227,6 +1227,46 @@
 	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 @@
   { "LogWindow",	NULL,			N_("_Log Window"),			NULL,			N_("Log Window"),			CB(layout_menu_log_window_cb) },
   { "ExifWin",		NULL,			N_("_Exif window"),			"<control>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"),	"<alt>Right",			N_("Next Pane"),	CB(layout_menu_split_pane_next_cb) },
+  { "SplitPreviousPane",	NULL,			N_("_Previous Pane"),	"<alt>Left",			N_("Previous Pane"),	CB(layout_menu_split_pane_prev_cb) },
 
 };
 
@@ -1803,6 +1845,9 @@
 "        <menuitem action='SplitVertical'/>"
 "        <menuitem action='SplitQuad'/>"
 "        <menuitem action='SplitSingle'/>"
+"        <separator/>"
+"        <menuitem action='SplitNextPane'/>"
+"        <menuitem action='SplitPreviousPane'/>"
 "      </menu>"
 "      <menu action='StereoMenu'>"
 "        <menuitem action='StereoAuto'/>"