From 1bd548f0732a8f9ecda3ff6633861fbb81131dad Mon Sep 17 00:00:00 2001 From: Alexander Schwinn Date: Wed, 6 Jun 2018 22:53:39 +0200 Subject: [PATCH] start to add property to enable/disable thumbnail frames --- thunar/thunar-icon-factory.c | 23 +++++++++++++++++++++++ thunar/thunar-preferences-dialog.c | 7 +++++++ thunar/thunar-preferences.c | 1 + 3 files changed, 31 insertions(+) diff --git a/thunar/thunar-icon-factory.c b/thunar/thunar-icon-factory.c index b39f414b..02d95480 100644 --- a/thunar/thunar-icon-factory.c +++ b/thunar/thunar-icon-factory.c @@ -49,6 +49,7 @@ enum PROP_0, PROP_ICON_THEME, PROP_THUMBNAIL_MODE, + PROP_THUMBNAIL_DRAW_FRAME, }; @@ -182,6 +183,20 @@ thunar_icon_factory_class_init (ThunarIconFactoryClass *klass) THUNAR_TYPE_THUMBNAIL_MODE, THUNAR_THUMBNAIL_MODE_ONLY_LOCAL, EXO_PARAM_READWRITE)); + + /** + * ThunarIconFactory:thumbnail-show-frame: + * + * Whether this #ThunarIconFactory will draw black frames around thumbnails. + * This looks neat, but will delay the first draw a bit, specially on older systems, on folders with many pictures. + **/ + g_object_class_install_property (gobject_class, + PROP_THUMBNAIL_DRAW_FRAME, + g_param_spec_boolean ("thumbnail-draw-frame", + "thumbnail-draw-frame", + "thumbnail-draw-frame", + FALSE, + EXO_PARAM_READWRITE)); } @@ -266,6 +281,10 @@ thunar_icon_factory_get_property (GObject *object, g_value_set_enum (value, factory->thumbnail_mode); break; + case PROP_THUMBNAIL_DRAW_FRAME: + g_value_set_boolean (value, factory->thumbnail_draw_frame); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -288,6 +307,10 @@ thunar_icon_factory_set_property (GObject *object, factory->thumbnail_mode = g_value_get_enum (value); break; + case PROP_THUMBNAIL_DRAW_FRAME: + factory->thumbnail_draw_frame = g_value_get_boolean (value); + break; + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; diff --git a/thunar/thunar-preferences-dialog.c b/thunar/thunar-preferences-dialog.c index dd19f6d0..d0b4fefc 100644 --- a/thunar/thunar-preferences-dialog.c +++ b/thunar/thunar-preferences-dialog.c @@ -303,6 +303,13 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_grid_attach (GTK_GRID (grid), button, 0, 2, 2, 1); gtk_widget_show (button); + button = gtk_check_button_new_with_mnemonic (_("Sort _folders before files")); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-folders-first", G_OBJECT (button), "active"); + gtk_widget_set_tooltip_text (button, _("Select this option to list folders before files when you sort a folder.")); + gtk_widget_set_hexpand (button, TRUE); + gtk_grid_attach (GTK_GRID (grid), button, 0, 2, 2, 1); + gtk_widget_show (button); + button = gtk_check_button_new_with_mnemonic (_("Show file size in binary format")); exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-file-size-binary", G_OBJECT (button), "active"); gtk_widget_set_tooltip_text (button, _("Select this option to show file size in binary format instead of decimal.")); diff --git a/thunar/thunar-preferences.c b/thunar/thunar-preferences.c index db92bf2a..475b8765 100644 --- a/thunar/thunar-preferences.c +++ b/thunar/thunar-preferences.c @@ -90,6 +90,7 @@ enum PROP_MISC_TAB_CLOSE_MIDDLE_CLICK, PROP_MISC_TEXT_BESIDE_ICONS, PROP_MISC_THUMBNAIL_MODE, + PROP_MISC_THUMBNAIL_DRAW_FRAME, PROP_MISC_FILE_SIZE_BINARY, PROP_SHORTCUTS_ICON_EMBLEMS, PROP_SHORTCUTS_ICON_SIZE, -- 2.11.0