Skip to content

Commit ccee05a

Browse files
committed
pathbar/entry: Fix a couple of issues when changing pathbar/entry
preference. - Showing/hiding the location entry manually in response to the radio buttons changing was causing a recursive loop - toggle the action instead. - Update the toolbar layout when the preference changes, as it was not updating properly if the entry was already (temporarily) visible and the preference changed to entry in that state.
1 parent ae42620 commit ccee05a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/nemo-toolbar.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ nemo_toolbar_constructed (GObject *obj)
393393
g_signal_connect_swapped (nemo_preferences,
394394
"changed::" NEMO_PREFERENCES_SHOW_IMAGE_FILE_THUMBNAILS,
395395
G_CALLBACK (toolbar_update_appearance), self);
396+
g_signal_connect_swapped (nemo_preferences,
397+
"changed::" NEMO_PREFERENCES_SHOW_LOCATION_ENTRY,
398+
G_CALLBACK (toolbar_update_appearance), self);
396399

397400
toolbar_update_appearance (self);
398401
}

src/nemo-window-menus.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -732,23 +732,27 @@ toolbar_radio_entry_changed_cb (GtkAction *action,
732732
GtkRadioAction *current,
733733
gpointer user_data)
734734
{
735-
gint current_value;
736735
NemoWindow *window = NEMO_WINDOW (user_data);
736+
NemoWindowPane *pane;
737+
GtkAction *toggle_action;
738+
gint current_value;
737739

738740
if (NEMO_IS_DESKTOP_WINDOW (window)) {
739741
return;
740742
}
741743

744+
pane = nemo_window_get_active_pane (window);
745+
toggle_action = gtk_action_group_get_action (pane->action_group, NEMO_ACTION_TOGGLE_LOCATION);
746+
742747
current_value = gtk_radio_action_get_current_value (current);
743748
switch (current_value) {
744749
case TOOLBAR_PATHBAR:
745750
g_settings_set_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_LOCATION_ENTRY, FALSE);
746-
NemoWindowPane *pane = nemo_window_get_active_pane (window);
747-
nemo_toolbar_set_show_location_entry (NEMO_TOOLBAR (pane->tool_bar), FALSE);
751+
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (toggle_action), FALSE);
748752
break;
749753
case TOOLBAR_ENTRY:
750754
g_settings_set_boolean (nemo_preferences, NEMO_PREFERENCES_SHOW_LOCATION_ENTRY, TRUE);
751-
nemo_window_show_location_entry (window);
755+
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (toggle_action), TRUE);
752756
break;
753757
default:
754758
;

0 commit comments

Comments
 (0)