changeset 2423:ba806fc7a4c1

Rectangular selection Add toggle Rectangular Selection to Select menu. Shortcut key is Alt-R. Also on Collection widow. Removed option from Preferences page as it is redundant
author Colin Clark <cclark@mcb.net>
date Wed, 04 Jan 2017 20:01:47 +0000
parents 0c734af3fedb
children 83d9886b9bcb
files doc/docbook/GuideMainWindowMenus.xml doc/docbook/GuideOptionsBehavior.xml doc/docbook/GuideReferenceKeyboardShortcuts.xml src/collect-table.c src/collect.c src/layout_util.c src/preferences.c
diffstat 7 files changed, 112 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/doc/docbook/GuideMainWindowMenus.xml	Mon Jan 02 19:37:33 2017 +0000
+++ b/doc/docbook/GuideMainWindowMenus.xml	Wed Jan 04 20:01:47 2017 +0000
@@ -81,7 +81,14 @@
       </varlistentry>
       <varlistentry>
         <term>
-          <guimenu>Find duplicates…</guimenu>
+          <menuchoice>
+            <shortcut>
+              <keycombo>
+                <keycap>D</keycap>
+              </keycombo>
+            </shortcut>
+            <guimenu>Find duplicates...</guimenu>
+          </menuchoice>
         </term>
         <listitem>
           <para>Opens a new Find Duplicates window.</para>
@@ -253,7 +260,7 @@
           <menuchoice>
             <shortcut>
               <keycombo>
-                <keycap>4</keycap>
+                <keycap>Backspace</keycap>
               </keycombo>
             </shortcut>
             <guimenu>Previous Image</guimenu>
@@ -330,6 +337,12 @@
       <varlistentry>
         <term>
           <menuchoice>
+            <shortcut>
+              <keycombo>
+                <keycap>Ctrl</keycap>
+                <keycap>A</keycap>
+              </keycombo>
+            </shortcut>
             <guimenu>Select all</guimenu>
           </menuchoice>
         </term>
@@ -340,6 +353,13 @@
       <varlistentry>
         <term>
           <menuchoice>
+            <shortcut>
+              <keycombo>
+                <keycap>Ctrl</keycap>
+                <keycap>Shift</keycap>
+                <keycap>A</keycap>
+              </keycombo>
+            </shortcut>
             <guimenu>Select none</guimenu>
           </menuchoice>
         </term>
@@ -350,7 +370,14 @@
       <varlistentry>
         <term>
           <menuchoice>
-            <guimenu>Invert Selection</guimenu>
+            <shortcut>
+              <keycombo>
+                <keycap>Ctrl</keycap>
+                <keycap>Shift</keycap>
+                <keycap>I</keycap>
+              </keycombo>
+            </shortcut>
+            <guimenu>Invert selection</guimenu>
           </menuchoice>
         </term>
         <listitem>
@@ -360,6 +387,22 @@
       <varlistentry>
         <term>
           <menuchoice>
+            <shortcut>
+              <keycombo>
+                <keycap>Alt</keycap>
+                <keycap>R</keycap>
+              </keycombo>
+            </shortcut>
+            <guimenu>Rectangular selection</guimenu>
+          </menuchoice>
+        </term>
+        <listitem>
+          <para>Toggles rectangular selection mode for icons</para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>
+          <menuchoice>
             <guimenu>Copy path</guimenu>
           </menuchoice>
         </term>
@@ -370,6 +413,11 @@
       <varlistentry>
         <term>
           <menuchoice>
+            <shortcut>
+              <keycombo>
+                <keycap>M</keycap>
+              </keycombo>
+            </shortcut>
             <guimenu>Show marks</guimenu>
           </menuchoice>
         </term>
--- a/doc/docbook/GuideOptionsBehavior.xml	Mon Jan 02 19:37:33 2017 +0000
+++ b/doc/docbook/GuideOptionsBehavior.xml	Wed Jan 04 20:01:47 2017 +0000
@@ -99,14 +99,6 @@
     <variablelist>
       <varlistentry>
         <term>
-          <guilabel>Rectangular selection in icon view</guilabel>
-        </term>
-        <listitem>
-          <para>Enable this to change the selection method used when selecting multiple items in an icon view.</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
           <guilabel>Descend folders in tree view</guilabel>
         </term>
         <listitem>
--- a/doc/docbook/GuideReferenceKeyboardShortcuts.xml	Mon Jan 02 19:37:33 2017 +0000
+++ b/doc/docbook/GuideReferenceKeyboardShortcuts.xml	Wed Jan 04 20:01:47 2017 +0000
@@ -514,6 +514,33 @@
             <entry />
             <entry>Unselect all images.</entry>
           </row>
+          <row>
+            <entry>
+              <code>
+                Ctrl + SHIFT +
+                <keycap>I</keycap>
+              </code>
+            </entry>
+            <entry />
+            <entry>Invert selection.</entry>
+          </row>
+          <row>
+            <entry>
+              <code>
+                Alt +
+                <keycap>R</keycap>
+              </code>
+            </entry>
+            <entry />
+            <entry>Toggle rectangular selection mode in icon view.</entry>
+          </row>
+          <row>
+            <entry>
+              <keycap>M</keycap>
+            </entry>
+            <entry />
+            <entry>Show marks.</entry>
+          </row>
           <row rowsep="0">
             <entry colsep="0" />
             <entry colsep="0" />
@@ -679,6 +706,16 @@
           </row>
           <row>
             <entry>
+              <code>
+                Alt +
+                <keycap>R</keycap>
+              </code>
+            </entry>
+            <entry />
+            <entry>Toggle rectangular selection mode.</entry>
+          </row>
+          <row>
+            <entry>
               <keycap>Space</keycap>
             </entry>
             <entry />
--- a/src/collect-table.c	Mon Jan 02 19:37:33 2017 +0000
+++ b/src/collect-table.c	Wed Jan 04 20:01:47 2017 +0000
@@ -808,6 +808,13 @@
 	ct->prev_selection= ct->click_info;
 }
 
+static void collection_table_popup_rectangular_selection_cb(GtkWidget *widget, gpointer data)
+{
+	CollectTable *ct = data;
+
+	options->collections.rectangular_selection = !(options->collections.rectangular_selection);
+}
+
 static void collection_table_popup_remove_cb(GtkWidget *widget, gpointer data)
 {
 	CollectTable *ct = data;
@@ -924,6 +931,8 @@
 			G_CALLBACK(collection_table_popup_unselectall_cb), ct);
 	menu_item_add(submenu, _("Invert selection"),
 			G_CALLBACK(collection_table_popup_select_invert_cb), ct);
+	menu_item_add_check(submenu, _("Rectangular selection"), (options->collections.rectangular_selection != FALSE),
+			G_CALLBACK(collection_table_popup_rectangular_selection_cb), ct);
 	gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
 	menu_item_add_divider(menu);
 
--- a/src/collect.c	Mon Jan 02 19:37:33 2017 +0000
+++ b/src/collect.c	Wed Jan 04 20:01:47 2017 +0000
@@ -908,6 +908,12 @@
 					collection_set_sort_method(cw->cd, SORT_PATH);
 					}
 				break;
+			case 'R': case 'r':
+				if (event->state & GDK_MOD1_MASK)
+					{
+						options->collections.rectangular_selection = !(options->collections.rectangular_selection);
+					}
+				break;
 			case GDK_KEY_Delete: case GDK_KEY_KP_Delete:
 				list = g_list_copy(cw->table->selection);
 				if (list)
--- a/src/layout_util.c	Mon Jan 02 19:37:33 2017 +0000
+++ b/src/layout_util.c	Wed Jan 04 20:01:47 2017 +0000
@@ -705,6 +705,13 @@
 		}
 }
 
+static void layout_menu_rectangular_selection_cb(GtkToggleAction *action, gpointer data)
+{
+	LayoutWindow *lw = data;
+
+	options->collections.rectangular_selection = gtk_toggle_action_get_active(action);
+}
+
 static void layout_menu_histogram_toggle_channel_cb(GtkAction *action, gpointer data)
 {
 	LayoutWindow *lw = data;
@@ -1581,6 +1588,7 @@
   { "Grayscale",	NULL,			N_("Toggle _grayscale"),		"<shift>G",		N_("Toggle grayscale"),			CB(layout_menu_alter_desaturate_cb), FALSE},
   { "ImageOverlay",	NULL,			N_("Image _Overlay"),			NULL,			N_("Image Overlay"),			CB(layout_menu_overlay_cb),	 FALSE },
   { "ImageHistogram",	NULL,			N_("_Show Histogram"),			NULL,			N_("Show Histogram"),			CB(layout_menu_histogram_cb),	 FALSE },
+  { "RectangularSelection",	NULL,			N_("Rectangular Selection"),			"<alt>R",			N_("Rectangular Selection"),			CB(layout_menu_rectangular_selection_cb),	 FALSE },
 };
 
 static GtkRadioActionEntry menu_radio_entries[] = {
@@ -1676,6 +1684,7 @@
 "      <menuitem action='SelectAll'/>"
 "      <menuitem action='SelectNone'/>"
 "      <menuitem action='SelectInvert'/>"
+"      <menuitem action='RectangularSelection'/>"
 "      <placeholder name='SelectSection'/>"
 "      <separator/>"
 "      <menuitem action='CopyPath'/>"
--- a/src/preferences.c	Mon Jan 02 19:37:33 2017 +0000
+++ b/src/preferences.c	Wed Jan 04 20:01:47 2017 +0000
@@ -276,8 +276,6 @@
 
 	options->file_ops.enable_in_place_rename = c_options->file_ops.enable_in_place_rename;
 
-	options->collections.rectangular_selection = c_options->collections.rectangular_selection;
-
 	options->image.tile_cache_max = c_options->image.tile_cache_max;
 	options->image.image_cache_max = c_options->image.image_cache_max;
 
@@ -2147,9 +2145,6 @@
 
 	group = pref_group_new(vbox, FALSE, _("Behavior"), GTK_ORIENTATION_VERTICAL);
 
-	pref_checkbox_new_int(group, _("Rectangular selection in icon view"),
-			      options->collections.rectangular_selection, &c_options->collections.rectangular_selection);
-
 	pref_checkbox_new_int(group, _("Descend folders in tree view"),
 			      options->tree_descend_subdirs, &c_options->tree_descend_subdirs);