mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-10-03 22:45:26 +00:00
general: Always show sidebar
Always show the sidebar, and remove the setting to hide it. We are going to introduce a replacement next commit: AdwFlap.
This commit is contained in:
parent
94ba087d09
commit
07db1d6ff2
|
@ -261,10 +261,5 @@
|
|||
<summary>Show location bar in new windows</summary>
|
||||
<description>If set to true, newly opened windows will have the location bar visible.</description>
|
||||
</key>
|
||||
<key type="b" name="start-with-sidebar">
|
||||
<default>true</default>
|
||||
<summary>Show side pane in new windows</summary>
|
||||
<description>If set to true, newly opened windows will have the side pane visible.</description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
|
|
|
@ -812,29 +812,6 @@ action_quit (GSimpleAction *action,
|
|||
g_list_free (windows);
|
||||
}
|
||||
|
||||
static void
|
||||
action_show_hide_sidebar (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
gpointer *user_data)
|
||||
{
|
||||
GList *window, *windows;
|
||||
GVariant *state = g_action_get_state (G_ACTION (object));
|
||||
|
||||
windows = gtk_application_get_windows (GTK_APPLICATION (user_data));
|
||||
|
||||
for (window = windows; window != NULL; window = window->next)
|
||||
{
|
||||
if (g_variant_get_boolean (state))
|
||||
{
|
||||
nautilus_window_show_sidebar (window->data);
|
||||
}
|
||||
else
|
||||
{
|
||||
nautilus_window_hide_sidebar (window->data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
action_show_help_overlay (GSimpleAction *action,
|
||||
GVariant *state,
|
||||
|
@ -846,29 +823,11 @@ action_show_help_overlay (GSimpleAction *action,
|
|||
g_action_group_activate_action (G_ACTION_GROUP (window), "show-help-overlay", NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
variant_get_mapping (GValue *value,
|
||||
GVariant *variant,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_value_set_variant (value, variant);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
variant_set_mapping (const GValue *value,
|
||||
const GVariantType *expected_type,
|
||||
gpointer user_data)
|
||||
{
|
||||
return g_value_get_variant (value);
|
||||
}
|
||||
|
||||
const static GActionEntry app_entries[] =
|
||||
{
|
||||
{ "new-window", action_new_window, NULL, NULL, NULL },
|
||||
{ "clone-window", action_clone_window, NULL, NULL, NULL },
|
||||
{ "preferences", action_preferences, NULL, NULL, NULL },
|
||||
{ "show-hide-sidebar", NULL, NULL, "true", NULL },
|
||||
{ "about", action_about, NULL, NULL, NULL },
|
||||
{ "help", action_help, NULL, NULL, NULL },
|
||||
{ "quit", action_quit, NULL, NULL, NULL },
|
||||
|
@ -879,36 +838,17 @@ const static GActionEntry app_entries[] =
|
|||
static void
|
||||
nautilus_init_application_actions (NautilusApplication *app)
|
||||
{
|
||||
GAction *sidebar_action;
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
|
||||
|
||||
sidebar_action = g_action_map_lookup_action (G_ACTION_MAP (app),
|
||||
"show-hide-sidebar");
|
||||
g_signal_connect (sidebar_action,
|
||||
"notify::state",
|
||||
G_CALLBACK (action_show_hide_sidebar),
|
||||
app);
|
||||
g_settings_bind_with_mapping (nautilus_window_state,
|
||||
NAUTILUS_WINDOW_STATE_START_WITH_SIDEBAR,
|
||||
sidebar_action,
|
||||
"state",
|
||||
G_SETTINGS_BIND_DEFAULT,
|
||||
variant_get_mapping,
|
||||
variant_set_mapping,
|
||||
NULL, NULL);
|
||||
|
||||
nautilus_application_set_accelerator (G_APPLICATION (app),
|
||||
"app.clone-window", "<Primary>n");
|
||||
nautilus_application_set_accelerator (G_APPLICATION (app),
|
||||
"app.help", "F1");
|
||||
nautilus_application_set_accelerator (G_APPLICATION (app),
|
||||
"app.quit", "<Primary>q");
|
||||
nautilus_application_set_accelerator (G_APPLICATION (app),
|
||||
"app.show-hide-sidebar", "F9");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -57,7 +57,6 @@ typedef enum
|
|||
#define NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY "always-use-location-entry"
|
||||
|
||||
/* Which views should be displayed for new windows */
|
||||
#define NAUTILUS_WINDOW_STATE_START_WITH_SIDEBAR "start-with-sidebar"
|
||||
#define NAUTILUS_WINDOW_STATE_INITIAL_SIZE "initial-size"
|
||||
#define NAUTILUS_WINDOW_STATE_MAXIMIZED "maximized"
|
||||
#define NAUTILUS_WINDOW_STATE_SIDEBAR_WIDTH "sidebar-width"
|
||||
|
|
|
@ -1068,27 +1068,6 @@ nautilus_window_set_up_sidebar (NautilusWindow *window)
|
|||
G_CALLBACK (places_sidebar_drag_perform_drop_cb), window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_hide_sidebar (NautilusWindow *window)
|
||||
{
|
||||
DEBUG ("Called hide_sidebar()");
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
gtk_widget_hide (window->places_sidebar);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_show_sidebar (NautilusWindow *window)
|
||||
{
|
||||
DEBUG ("Called show_sidebar()");
|
||||
|
||||
g_return_if_fail (NAUTILUS_IS_WINDOW (window));
|
||||
|
||||
gtk_widget_show (window->places_sidebar);
|
||||
setup_side_pane_width (window);
|
||||
}
|
||||
|
||||
void
|
||||
nautilus_window_slot_close (NautilusWindow *window,
|
||||
NautilusWindowSlot *slot)
|
||||
|
@ -1609,8 +1588,6 @@ static void
|
|||
nautilus_window_initialize_actions (NautilusWindow *window)
|
||||
{
|
||||
GApplication *app;
|
||||
GAction *action;
|
||||
GVariant *state;
|
||||
gchar detailed_action[80];
|
||||
gchar accel[80];
|
||||
gint i;
|
||||
|
@ -1658,15 +1635,6 @@ nautilus_window_initialize_actions (NautilusWindow *window)
|
|||
}
|
||||
|
||||
#undef ACCELS
|
||||
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "show-hide-sidebar");
|
||||
state = g_action_get_state (action);
|
||||
if (g_variant_get_boolean (state))
|
||||
{
|
||||
nautilus_window_show_sidebar (window);
|
||||
}
|
||||
|
||||
g_variant_unref (state);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -76,8 +76,6 @@ void nautilus_window_slot_close (NautilusWindow *wind
|
|||
|
||||
void nautilus_window_sync_location_widgets (NautilusWindow *window);
|
||||
|
||||
void nautilus_window_hide_sidebar (NautilusWindow *window);
|
||||
void nautilus_window_show_sidebar (NautilusWindow *window);
|
||||
void nautilus_window_reset_menus (NautilusWindow *window);
|
||||
|
||||
GtkWidget * nautilus_window_get_notebook (NautilusWindow *window);
|
||||
|
|
|
@ -62,10 +62,6 @@
|
|||
<attribute name="label" translatable="yes">Show _Hidden Files</attribute>
|
||||
<attribute name="action">view.show-hidden-files</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Show _Sidebar</attribute>
|
||||
<attribute name="action">app.show-hide-sidebar</attribute>
|
||||
</item>
|
||||
</section>
|
||||
<section>
|
||||
<item>
|
||||
|
|
|
@ -48,7 +48,6 @@
|
|||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="NautilusGtkPlacesSidebar" id="places_sidebar">
|
||||
<property name="visible">False</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="show-other-locations">True</property>
|
||||
<property name="show-starred-location">True</property>
|
||||
|
|
Loading…
Reference in a new issue