diff options
author | Wu Xiaotian <[email protected]> | 2019-07-25 22:32:36 +0800 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-07-27 20:08:46 +0000 |
commit | 25c9935c888006f8a540d7bcaadb99a9a52bf4d0 (patch) | |
tree | 2fc244ab5fdc3ce7409d8399d1b6644589985e95 | |
parent | d3af9ff752a3ec22670a19352c1e034c60288068 (diff) | |
download | caja-25c9935c888006f8a540d7bcaadb99a9a52bf4d0.tar.bz2 caja-25c9935c888006f8a540d7bcaadb99a9a52bf4d0.tar.xz |
Add preference option to hide icons in list view.
-rw-r--r-- | libcaja-private/caja-global-preferences.h | 1 | ||||
-rw-r--r-- | libcaja-private/org.mate.caja.gschema.xml | 5 | ||||
-rw-r--r-- | src/caja-file-management-properties.c | 5 | ||||
-rw-r--r-- | src/caja-file-management-properties.ui | 49 | ||||
-rw-r--r-- | src/file-manager/fm-list-model.c | 14 | ||||
-rw-r--r-- | src/ui-a11y.suppr | 1 |
6 files changed, 75 insertions, 0 deletions
diff --git a/libcaja-private/caja-global-preferences.h b/libcaja-private/caja-global-preferences.h index d3e4b7ce..a7df4928 100644 --- a/libcaja-private/caja-global-preferences.h +++ b/libcaja-private/caja-global-preferences.h @@ -68,6 +68,7 @@ G_BEGIN_DECLS #define CAJA_PREFERENCES_SHOW_ADVANCED_PERMISSIONS "show-advanced-permissions" #define CAJA_PREFERENCES_DATE_FORMAT "date-format" #define CAJA_PREFERENCES_USE_IEC_UNITS "use-iec-units" +#define CAJA_PREFERENCES_HIDE_ICON_IN_LIST_VIEW "hide-icons-in-list-view" /* Mouse */ #define CAJA_PREFERENCES_MOUSE_USE_EXTRA_BUTTONS "mouse-use-extra-buttons" diff --git a/libcaja-private/org.mate.caja.gschema.xml b/libcaja-private/org.mate.caja.gschema.xml index 8ecc1977..481372ee 100644 --- a/libcaja-private/org.mate.caja.gschema.xml +++ b/libcaja-private/org.mate.caja.gschema.xml @@ -259,6 +259,11 @@ <summary>Whether to show file sizes with IEC units</summary> <description>If set to true, file sizes are shown using IEC (base 1024) units with "KiB" style suffixes, instead of default with SI units.</description> </key> + <key name="hide-icons-in-list-view" type="b"> + <default>false</default> + <summary>Whether to hide icons in list view</summary> + <description>If set to true, hide file icons in list view.</description> + </key> <key name="show-notifications" type="b"> <default>true</default> <summary>Whether to show desktop notifications</summary> diff --git a/src/caja-file-management-properties.c b/src/caja-file-management-properties.c index d361d15d..9596461e 100644 --- a/src/caja-file-management-properties.c +++ b/src/caja-file-management-properties.c @@ -73,6 +73,7 @@ #define CAJA_FILE_MANAGEMENT_PROPERTIES_MEDIA_AUTOMOUNT_OPEN "media_automount_open_checkbutton" #define CAJA_FILE_MANAGEMENT_PROPERTIES_MEDIA_AUTORUN_NEVER "media_autorun_never_checkbutton" #define CAJA_FILE_MANAGEMENT_PROPERTIES_USE_IEC_UNITS_WIDGET "use_iec_units" +#define CAJA_FILE_MANAGEMENT_PROPERTIES_HIDE_ICON_IN_LIST_VIEW "hide_icons_in_list_view" /* int enums */ #define CAJA_FILE_MANAGEMENT_PROPERTIES_THUMBNAIL_LIMIT_WIDGET "preview_image_size_combobox" @@ -1192,6 +1193,10 @@ caja_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow *wi CAJA_FILE_MANAGEMENT_PROPERTIES_USE_IEC_UNITS_WIDGET, CAJA_PREFERENCES_USE_IEC_UNITS); + bind_builder_bool (builder, caja_preferences, + CAJA_FILE_MANAGEMENT_PROPERTIES_HIDE_ICON_IN_LIST_VIEW, + CAJA_PREFERENCES_HIDE_ICON_IN_LIST_VIEW); + bind_builder_enum (builder, caja_preferences, CAJA_FILE_MANAGEMENT_PROPERTIES_DEFAULT_VIEW_WIDGET, CAJA_PREFERENCES_DEFAULT_FOLDER_VIEWER, diff --git a/src/caja-file-management-properties.ui b/src/caja-file-management-properties.ui index aa337c2f..903301e7 100644 --- a/src/caja-file-management-properties.ui +++ b/src/caja-file-management-properties.ui @@ -1519,6 +1519,55 @@ <property name="position">2</property> </packing> </child> + <child> + <object class="GtkBox" id="vbox33"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> + <child> + <object class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes"><b>List View</b></property> + <property name="use_markup">True</property> + <property name="xalign">0</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkAlignment" id="alignment15"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkCheckButton" id="hide_icons_in_list_view"> + <property name="label" translatable="yes">_Hide icons in list view</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">3</property> + </packing> + </child> </object> <packing> <property name="position">2</property> diff --git a/src/file-manager/fm-list-model.c b/src/file-manager/fm-list-model.c index d8b99aad..3b7f03b0 100644 --- a/src/file-manager/fm-list-model.c +++ b/src/file-manager/fm-list-model.c @@ -37,6 +37,7 @@ #include <eel/eel-graphic-effects.h> #include <libcaja-private/caja-dnd.h> +#include <libcaja-private/caja-global-preferences.h> #include "fm-list-model.h" @@ -321,6 +322,19 @@ fm_list_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, int column case FM_LIST_MODEL_LARGE_ICON_COLUMN: case FM_LIST_MODEL_LARGER_ICON_COLUMN: case FM_LIST_MODEL_LARGEST_ICON_COLUMN: + if (g_settings_get_boolean (caja_preferences, CAJA_PREFERENCES_HIDE_ICON_IN_LIST_VIEW)) { + cairo_surface_t *surface; + int icon_size; + + g_value_init (value, CAIRO_GOBJECT_TYPE_SURFACE); + + zoom_level = fm_list_model_get_zoom_level_from_column_id (column); + icon_size = caja_get_icon_size_for_zoom_level (zoom_level); + + surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, icon_size, icon_size); + g_value_take_boxed (value, surface); + break; + } g_value_init (value, CAIRO_GOBJECT_TYPE_SURFACE); if (file != NULL) diff --git a/src/ui-a11y.suppr b/src/ui-a11y.suppr index c257b3c7..cc6decc2 100644 --- a/src/ui-a11y.suppr +++ b/src/ui-a11y.suppr @@ -32,4 +32,5 @@ caja-file-management-properties.ui://GtkLabel[@id='label60'] orphan-label caja-file-management-properties.ui://GtkLabel[@id='label61'] orphan-label caja-file-management-properties.ui://GtkLabel[@id='label65'] orphan-label caja-file-management-properties.ui://GtkLabel[@id='label7'] orphan-label +caja-file-management-properties.ui://GtkLabel[@id='label8'] orphan-label caja-file-management-properties.ui://GtkTreeView[@id='extension_view'] no-labelled-by |