[nautilus: 15/16] view: Make the zoom slider the preference itself
- From: Carlos Soriano Sánchez <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus: 15/16] view: Make the zoom slider the preference itself
- Date: Wed, 22 Apr 2015 18:58:16 +0000 (UTC)
commit 986eafd989bdaf8ad003a61e2ed0fa8d21dab87b
Author: Carlos Soriano <csoriano gnome org>
Date: Wed Apr 22 16:21:07 2015 +0200
view: Make the zoom slider the preference itself
With the recent changes of the zoom, some people wanted to
have by default the smaller zoom level. They changed the slider
and expected to set the setting as well, so further applications
openings had that zoom level.
But changed on the zoom were intended only for the current view
and not altering the preference. And instead, if you wanted to
make it permanent you needed to go to Preferences and change it there.
Seems that was confusing for the users, so instead use the slider
as the permanent preference and remove the zoom preferences from
the Preferences dialog.
src/nautilus-canvas-view.c | 3 +
src/nautilus-file-management-properties.c | 19 +---
src/nautilus-file-management-properties.ui | 188 ----------------------------
src/nautilus-list-view.c | 3 +
4 files changed, 7 insertions(+), 206 deletions(-)
---
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index b71753a..b7f4edb 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -968,6 +968,9 @@ action_zoom_to_level (GSimpleAction *action,
nautilus_canvas_view_zoom_to_level (view, zoom_level);
g_simple_action_set_state (G_SIMPLE_ACTION (action), state);
+ g_settings_set_enum (nautilus_icon_view_preferences,
+ NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
+ zoom_level);
}
static void
diff --git a/src/nautilus-file-management-properties.c b/src/nautilus-file-management-properties.c
index 2b8a158..3714d12 100644
--- a/src/nautilus-file-management-properties.c
+++ b/src/nautilus-file-management-properties.c
@@ -41,8 +41,6 @@
/* string enum preferences */
#define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_DEFAULT_VIEW_WIDGET "default_view_combobox"
-#define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ICON_VIEW_ZOOM_WIDGET "icon_view_zoom_combobox"
-#define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_LIST_VIEW_ZOOM_WIDGET "list_view_zoom_combobox"
#define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_SORT_ORDER_WIDGET "sort_order_combobox"
#define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_PREVIEW_FILES_WIDGET "preview_image_combobox"
#define NAUTILUS_FILE_MANAGEMENT_PROPERTIES_PREVIEW_FOLDER_WIDGET "preview_folder_combobox"
@@ -62,13 +60,6 @@ static const char * const default_view_values[] = {
NULL
};
-static const char * const zoom_values[] = {
- "small",
- "standard",
- "large",
- NULL
-};
-
static const char * const sort_order_values[] = {
"name",
"size",
@@ -591,7 +582,7 @@ nautilus_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow
/* setup UI */
nautilus_file_management_properties_size_group_create (builder,
"views_label",
- 4);
+ 2);
nautilus_file_management_properties_size_group_create (builder,
"captions_label",
3);
@@ -621,14 +612,6 @@ nautilus_file_management_properties_dialog_setup (GtkBuilder *builder, GtkWindow
NAUTILUS_FILE_MANAGEMENT_PROPERTIES_DEFAULT_VIEW_WIDGET,
NAUTILUS_PREFERENCES_DEFAULT_FOLDER_VIEWER,
(const char **) default_view_values);
- bind_builder_enum (builder, nautilus_icon_view_preferences,
- NAUTILUS_FILE_MANAGEMENT_PROPERTIES_ICON_VIEW_ZOOM_WIDGET,
- NAUTILUS_PREFERENCES_ICON_VIEW_DEFAULT_ZOOM_LEVEL,
- (const char **) zoom_values);
- bind_builder_enum (builder, nautilus_list_view_preferences,
- NAUTILUS_FILE_MANAGEMENT_PROPERTIES_LIST_VIEW_ZOOM_WIDGET,
- NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
- (const char **) zoom_values);
bind_builder_enum (builder, nautilus_preferences,
NAUTILUS_FILE_MANAGEMENT_PROPERTIES_SORT_ORDER_WIDGET,
NAUTILUS_PREFERENCES_DEFAULT_SORT_ORDER,
diff --git a/src/nautilus-file-management-properties.ui b/src/nautilus-file-management-properties.ui
index 5afcf7c..3448f0e 100644
--- a/src/nautilus-file-management-properties.ui
+++ b/src/nautilus-file-management-properties.ui
@@ -212,194 +212,6 @@
<property name="position">0</property>
</packing>
</child>
- <child>
- <object class="GtkBox" id="vbox3">
- <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="label5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Icon View Defaults</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkBox" id="vbox16">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkBox" id="hbox35">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="views_label_2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Default _zoom level:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">icon_view_zoom_combobox</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="icon_view_zoom_combobox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">icon_view_zoom_levels</property>
- <child>
- <object class="GtkCellRendererText" id="renderer3"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="vbox4">
- <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="label6">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">List View Defaults</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="left_padding">12</property>
- <child>
- <object class="GtkBox" id="vbox15">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkBox" id="hbox36">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">12</property>
- <child>
- <object class="GtkLabel" id="views_label_3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">D_efault zoom level:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">list_view_zoom_combobox</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkComboBox" id="list_view_zoom_combobox">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="model">list_view_zoom_levels</property>
- <child>
- <object class="GtkCellRendererText" id="renderer5"/>
- <attributes>
- <attribute name="text">0</attribute>
- </attributes>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
</object>
<packing>
<property name="tab_expand">True</property>
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 963925d..2ea175e 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -2871,6 +2871,9 @@ action_zoom_to_level (GSimpleAction *action,
nautilus_list_view_zoom_to_level (view, zoom_level);
g_simple_action_set_state (G_SIMPLE_ACTION (action), state);
+ g_settings_set_enum (nautilus_list_view_preferences,
+ NAUTILUS_PREFERENCES_LIST_VIEW_DEFAULT_ZOOM_LEVEL,
+ zoom_level);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]