Fix #488: Issues using Geeqie to compare pictures
authorColin Clark <colin.clark@cclark.uk>
Wed, 31 May 2017 10:56:38 +0000 (11:56 +0100)
committerColin Clark <colin.clark@cclark.uk>
Wed, 31 May 2017 10:56:38 +0000 (11:56 +0100)
https://github.com/BestImageViewer/geeqie/issues/488

Part 3: Use alt+left/right arrow keys to move between split window panes

doc/docbook/GuideReferenceKeyboardShortcuts.xml
src/layout_util.c

index eb9bec8..a07aa97 100644 (file)
             <entry />\r
             <entry>Toggle slideshow.</entry>\r
           </row>\r
+          <row>\r
+            <entry>\r
+              <keycap>E</keycap>\r
+            </entry>\r
+            <entry />\r
+            <entry>Split panes horizontal.</entry>\r
+          </row>\r
+          <row>\r
+            <entry>\r
+              <keycap>U</keycap>\r
+            </entry>\r
+            <entry />\r
+            <entry>Split panes vertical.</entry>\r
+          </row>\r
+          <row>\r
+            <entry>\r
+              <keycap>Y</keycap>\r
+            </entry>\r
+            <entry />\r
+            <entry>Single pane.</entry>\r
+          </row>\r
+          <row>\r
+            <entry>\r
+              <code>Alt + Right Arrow</code>\r
+            </entry>\r
+            <entry />\r
+            <entry>Next split pane.</entry>\r
+          </row>\r
+          <row>\r
+            <entry>\r
+              <code>Alt + Left Arrow</code>\r
+            </entry>\r
+            <entry />\r
+            <entry>Previous split pane.</entry>\r
+          </row>\r
         </tbody>\r
       </tgroup>\r
     </table>\r
index 5616fc0..ffc5d6c 100644 (file)
@@ -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"),                     "<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 @@ static const gchar *menu_ui_description =
 "        <menuitem action='SplitVertical'/>"
 "        <menuitem action='SplitQuad'/>"
 "        <menuitem action='SplitSingle'/>"
+"        <separator/>"
+"        <menuitem action='SplitNextPane'/>"
+"        <menuitem action='SplitPreviousPane'/>"
 "      </menu>"
 "      <menu action='StereoMenu'>"
 "        <menuitem action='StereoAuto'/>"