Skip to content

Commit 4c72b53

Browse files
add touch screen mode to always show the checkboxes (not just when hovered by a pointer)
1 parent fe9a2e5 commit 4c72b53

6 files changed

Lines changed: 59 additions & 6 deletions

File tree

gresources/nemo-file-management-properties.glade

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,23 @@ along with . If not, see <http://www.gnu.org/licenses/>.
12231223
<property name="position">1</property>
12241224
</packing>
12251225
</child>
1226+
<child>
1227+
<object class="GtkCheckButton" id="show_selection_checkboxes_always_checkbutton">
1228+
<property name="label" translatable="yes">Touch mode: Always show selection checkboxes</property>
1229+
<property name="visible">True</property>
1230+
<property name="can-focus">True</property>
1231+
<property name="receives-default">False</property>
1232+
<property name="use-underline">True</property>
1233+
<property name="xalign">0</property>
1234+
<property name="draw-indicator">True</property>
1235+
<property name="margin-start">18</property>
1236+
</object>
1237+
<packing>
1238+
<property name="expand">False</property>
1239+
<property name="fill">False</property>
1240+
<property name="position">2</property>
1241+
</packing>
1242+
</child>
12261243
<child>
12271244
<object class="GtkCheckButton" id="ignore_view_metadata_checkbutton">
12281245
<property name="label" translatable="yes">Ignore per-folder view preferences</property>
@@ -1236,7 +1253,7 @@ along with . If not, see <http://www.gnu.org/licenses/>.
12361253
<packing>
12371254
<property name="expand">False</property>
12381255
<property name="fill">False</property>
1239-
<property name="position">2</property>
1256+
<property name="position">3</property>
12401257
</packing>
12411258
</child>
12421259
<child>
@@ -1252,7 +1269,7 @@ along with . If not, see <http://www.gnu.org/licenses/>.
12521269
<packing>
12531270
<property name="expand">False</property>
12541271
<property name="fill">False</property>
1255-
<property name="position">3</property>
1272+
<property name="position">4</property>
12561273
</packing>
12571274
</child>
12581275
<child>
@@ -1286,7 +1303,7 @@ along with . If not, see <http://www.gnu.org/licenses/>.
12861303
<property name="expand">False</property>
12871304
<property name="fill">False</property>
12881305
<property name="padding">3</property>
1289-
<property name="position">5</property>
1306+
<property name="position">6</property>
12901307
</packing>
12911308
</child>
12921309
<child>
@@ -1302,7 +1319,7 @@ along with . If not, see <http://www.gnu.org/licenses/>.
13021319
<packing>
13031320
<property name="expand">False</property>
13041321
<property name="fill">False</property>
1305-
<property name="position">6</property>
1322+
<property name="position">7</property>
13061323
</packing>
13071324
</child>
13081325
</object>

libnemo-private/nemo-global-preferences.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ typedef enum
146146
#define NEMO_PREFERENCES_START_WITH_DUAL_PANE "start-with-dual-pane"
147147
#define NEMO_PREFERENCES_RESTORE_TABS_ON_STARTUP "restore-tabs-on-startup"
148148
#define NEMO_PREFERENCES_SHOW_SELECTION_CHECKBOXES "show-selection-checkboxes"
149+
#define NEMO_PREFERENCES_SHOW_SELECTION_CHECKBOXES_ALWAYS "show-selection-checkboxes-always"
149150
#define NEMO_PREFERENCES_IGNORE_VIEW_METADATA "ignore-view-metadata"
150151
#define NEMO_PREFERENCES_SHOW_BOOKMARKS_IN_TO_MENUS "show-bookmarks-in-to-menus"
151152
#define NEMO_PREFERENCES_SHOW_PLACES_IN_TO_MENUS "show-places-in-to-menus"

libnemo-private/nemo-icon-canvas-item.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,7 @@ draw_selection_checkbox (NemoIconCanvasItem *icon_item,
13611361
double pixels_per_unit;
13621362
gboolean selected;
13631363
gboolean show_selection_checkboxes;
1364+
gboolean show_selection_checkboxes_always;
13641365
GdkPixbuf *checkbox_pixbuf;
13651366

13661367
show_selection_checkboxes = g_settings_get_boolean (nemo_preferences,
@@ -1370,7 +1371,9 @@ draw_selection_checkbox (NemoIconCanvasItem *icon_item,
13701371
}
13711372

13721373
selected = icon_item->details->is_highlighted_for_selection;
1373-
if (!icon_item->details->is_prelit && !selected) {
1374+
show_selection_checkboxes_always = g_settings_get_boolean (nemo_preferences,
1375+
NEMO_PREFERENCES_SHOW_SELECTION_CHECKBOXES_ALWAYS);
1376+
if (!show_selection_checkboxes_always && !icon_item->details->is_prelit && !selected) {
13741377
return;
13751378
}
13761379

libnemo-private/nemo-icon-container.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ tooltip_prefs_changed_callback (NemoIconContainer *container)
217217
nemo_icon_container_request_update_all (container);
218218
}
219219

220+
static void
221+
selection_checkboxes_prefs_changed_callback (NemoIconContainer *container)
222+
{
223+
gtk_widget_queue_draw (GTK_WIDGET (container));
224+
}
225+
220226
/* Functions dealing with NemoIcons. */
221227

222228
static gboolean
@@ -2766,6 +2772,9 @@ finalize (GObject *object)
27662772
g_signal_handlers_disconnect_by_func (nemo_preferences,
27672773
tooltip_prefs_changed_callback,
27682774
object);
2775+
g_signal_handlers_disconnect_by_func (nemo_preferences,
2776+
selection_checkboxes_prefs_changed_callback,
2777+
object);
27692778

27702779
g_hash_table_destroy (details->icon_set);
27712780
details->icon_set = NULL;
@@ -5011,6 +5020,16 @@ nemo_icon_container_init (NemoIconContainer *container)
50115020
G_CALLBACK (tooltip_prefs_changed_callback),
50125021
container);
50135022

5023+
g_signal_connect_swapped (nemo_preferences,
5024+
"changed::" NEMO_PREFERENCES_SHOW_SELECTION_CHECKBOXES,
5025+
G_CALLBACK (selection_checkboxes_prefs_changed_callback),
5026+
container);
5027+
5028+
g_signal_connect_swapped (nemo_preferences,
5029+
"changed::" NEMO_PREFERENCES_SHOW_SELECTION_CHECKBOXES_ALWAYS,
5030+
G_CALLBACK (selection_checkboxes_prefs_changed_callback),
5031+
container);
5032+
50145033
container->details->show_desktop_tooltips = g_settings_get_boolean (nemo_preferences,
50155034
NEMO_PREFERENCES_TOOLTIPS_DESKTOP);
50165035
container->details->show_icon_view_tooltips = g_settings_get_boolean (nemo_preferences,

libnemo-private/org.nemo.gschema.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,12 @@
354354
<key name="show-selection-checkboxes" type="b">
355355
<default>false</default>
356356
<summary>Enable item selection checkboxes</summary>
357-
<description>If set to true, Nemo will show clickable checkboxes on hovered items in icon and compact views, and beside all items in list view to make mouse-only multi-selection easier.</description>
357+
<description>If set to true, Nemo will show clickable checkboxes on items in icon and compact views, and beside all items in list view to make mouse-only multi-selection easier.</description>
358+
</key>
359+
<key name="show-selection-checkboxes-always" type="b">
360+
<default>false</default>
361+
<summary>Always show item selection checkboxes</summary>
362+
<description>If set to true, Nemo will always show item selection checkboxes in icon and compact views instead of showing them only for selected or hovered items.</description>
358363
</key>
359364
<key name="ignore-view-metadata" type="b">
360365
<default>false</default>

src/nemo-file-management-properties.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
#define NEMO_FILE_MANAGEMENT_PROPERTIES_RESTORE_TABS_ON_STARTUP_WIDGET "restore_tabs_on_startup_checkbutton"
103103
#define NEMO_FILE_MANAGEMENT_PROPERTIES_IGNORE_VIEW_METADATA_WIDGET "ignore_view_metadata_checkbutton"
104104
#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_SELECTION_CHECKBOXES_WIDGET "show_selection_checkboxes_checkbutton"
105+
#define NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_SELECTION_CHECKBOXES_ALWAYS_WIDGET "show_selection_checkboxes_always_checkbutton"
105106
#define NEMO_FILE_MANAGEMENT_PROPERTIES_BOOKMARKS_IN_TO_MENUS_WIDGET "bookmarks_in_to_checkbutton"
106107
#define NEMO_FILE_MANAGEMENT_PROPERTIES_PLACES_IN_TO_MENUS_WIDGET "places_in_to_checkbutton"
107108
#define NEMO_FILE_MANAGEMENT_PROPERTIES_INHERIT_SHOW_THUMBNAILS_WIDGET "inherit_show_thumbnails_checkbutton"
@@ -1081,6 +1082,13 @@ nemo_file_management_properties_dialog_setup (GtkBuilder *builder,
10811082
NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_SELECTION_CHECKBOXES_WIDGET,
10821083
NEMO_PREFERENCES_SHOW_SELECTION_CHECKBOXES);
10831084

1085+
bind_builder_bool (builder, nemo_preferences,
1086+
NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_SELECTION_CHECKBOXES_ALWAYS_WIDGET,
1087+
NEMO_PREFERENCES_SHOW_SELECTION_CHECKBOXES_ALWAYS);
1088+
g_settings_bind (nemo_preferences, NEMO_PREFERENCES_SHOW_SELECTION_CHECKBOXES,
1089+
gtk_builder_get_object (builder, NEMO_FILE_MANAGEMENT_PROPERTIES_SHOW_SELECTION_CHECKBOXES_ALWAYS_WIDGET),
1090+
"sensitive", G_SETTINGS_BIND_GET);
1091+
10841092
bind_builder_bool (builder, nemo_preferences,
10851093
NEMO_FILE_MANAGEMENT_PROPERTIES_BOOKMARKS_IN_TO_MENUS_WIDGET,
10861094
NEMO_PREFERENCES_SHOW_BOOKMARKS_IN_TO_MENUS);

0 commit comments

Comments
 (0)