diff options
author | Carlos Soriano <csoriano1618@gmail.com> | 2018-01-12 08:34:02 +0000 |
---|---|---|
committer | Carlos Soriano <csoriano1618@gmail.com> | 2018-01-12 08:34:02 +0000 |
commit | 074cecf4095093c2ba2c96dc7e3ca15f5013c3d2 (patch) | |
tree | f52c2507e935d1de1fa2f8562734469ad1200669 | |
parent | c66bbbdd5aa39d010b5c428727798ef62e88c54c (diff) | |
parent | 09f6b6611bfab3999241322793ef4205880424e1 (diff) | |
download | nautilus-074cecf4095093c2ba2c96dc7e3ca15f5013c3d2.tar.gz |
Merge branch 'wip/antares/issue63' into 'master'
nautilus-toolbar : Add close button to close location entry
See merge request GNOME/nautilus!45
-rw-r--r-- | src/nautilus-toolbar.c | 16 | ||||
-rw-r--r-- | src/resources/ui/nautilus-toolbar.ui | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c index a6d01b8cb..d975d9c43 100644 --- a/src/nautilus-toolbar.c +++ b/src/nautilus-toolbar.c @@ -93,6 +93,7 @@ struct _NautilusToolbar GtkWidget *forward_button; GtkWidget *back_button; + GtkWidget *location_entry_close_button; NautilusProgressInfoManager *progress_manager; @@ -125,7 +126,7 @@ toolbar_update_appearance (NautilusToolbar *self) g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_ALWAYS_USE_LOCATION_ENTRY); - gtk_widget_set_visible (self->location_entry, + gtk_widget_set_visible (self->location_entry_container, show_location_entry); gtk_widget_set_visible (self->path_bar, !show_location_entry); @@ -869,6 +870,13 @@ undo_manager_changed (NautilusToolbar *self) update_menu_item (self->redo_button, self, "redo", redo_active, redo_label); } +static void +on_location_entry_close (GtkWidget *close_button, + NautilusToolbar *self) +{ + nautilus_toolbar_set_show_location_entry (self, FALSE); +} + static gboolean on_location_entry_populate_popup (GtkEntry *entry, GtkWidget *widget, @@ -941,6 +949,12 @@ nautilus_toolbar_init (NautilusToolbar *self) self->location_entry = nautilus_location_entry_new (); gtk_container_add (GTK_CONTAINER (self->location_entry_container), self->location_entry); + self->location_entry_close_button = gtk_button_new_from_icon_name ("window-close-symbolic", + GTK_ICON_SIZE_BUTTON); + gtk_container_add (GTK_CONTAINER (self->location_entry_container), + self->location_entry_close_button); + g_signal_connect (self->location_entry_close_button, "clicked", + G_CALLBACK (on_location_entry_close), self); self->progress_manager = nautilus_progress_info_manager_dup_singleton (); g_signal_connect (self->progress_manager, "new-progress-info", diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui index ef384223e..59d3fea04 100644 --- a/src/resources/ui/nautilus-toolbar.ui +++ b/src/resources/ui/nautilus-toolbar.ui @@ -68,6 +68,9 @@ </child> <child> <object class="GtkBox" id="location_entry_container"> + <style> + <class name="linked"/> + </style> </object> <packing> <property name="pack-type">start</property> |