diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2013-08-24 19:05:31 -0700 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2013-08-24 19:06:28 -0700 |
commit | 2e838500607ab949900a0f61cc32b6565cdd7fc6 (patch) | |
tree | 72d6a4bbe0e7ac6675f7be1f2465efe3aa6b9a9a | |
parent | 6d2561ba2b8db8c0f1760a84dedd08686cfc693f (diff) | |
download | nautilus-2e838500607ab949900a0f61cc32b6565cdd7fc6.tar.gz |
slot: add a revealer for the searchbar
https://bugzilla.gnome.org/show_bug.cgi?id=706674
-rw-r--r-- | src/nautilus-window-slot.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c index cdfd48a03..545eee444 100644 --- a/src/nautilus-window-slot.c +++ b/src/nautilus-window-slot.c @@ -97,6 +97,7 @@ struct NautilusWindowSlotDetails { /* Query editor */ NautilusQueryEditor *query_editor; + GtkWidget *query_editor_revealer; gulong qe_changed_id; gulong qe_cancel_id; gulong qe_activated_id; @@ -299,7 +300,8 @@ query_editor_changed_callback (NautilusQueryEditor *editor, static void hide_query_editor (NautilusWindowSlot *slot) { - gtk_widget_hide (GTK_WIDGET (slot->details->query_editor)); + gtk_revealer_set_reveal_child (GTK_REVEALER (slot->details->query_editor_revealer), + FALSE); if (slot->details->qe_changed_id > 0) { g_signal_handler_disconnect (slot->details->query_editor, slot->details->qe_changed_id); @@ -347,7 +349,8 @@ show_query_editor (NautilusWindowSlot *slot) nautilus_directory_unref (directory); - gtk_widget_show (GTK_WIDGET (slot->details->query_editor)); + gtk_revealer_set_reveal_child (GTK_REVEALER (slot->details->query_editor_revealer), + TRUE); gtk_widget_grab_focus (GTK_WIDGET (slot->details->query_editor)); if (slot->details->qe_changed_id == 0) { @@ -505,7 +508,7 @@ remove_all_extra_location_widgets (GtkWidget *widget, NautilusDirectory *directory; directory = nautilus_directory_get (slot->details->location); - if (widget != GTK_WIDGET (slot->details->query_editor)) { + if (widget != GTK_WIDGET (slot->details->query_editor_revealer)) { gtk_container_remove (GTK_CONTAINER (slot->details->extra_location_widgets), widget); } @@ -583,9 +586,11 @@ nautilus_window_slot_constructed (GObject *object) gtk_widget_show (extras_vbox); slot->details->query_editor = NAUTILUS_QUERY_EDITOR (nautilus_query_editor_new ()); - nautilus_window_slot_add_extra_location_widget (slot, GTK_WIDGET (slot->details->query_editor)); - g_object_add_weak_pointer (G_OBJECT (slot->details->query_editor), - (gpointer *) &slot->details->query_editor); + slot->details->query_editor_revealer = gtk_revealer_new (); + gtk_container_add (GTK_CONTAINER (slot->details->query_editor_revealer), + GTK_WIDGET (slot->details->query_editor)); + gtk_widget_show_all (slot->details->query_editor_revealer); + nautilus_window_slot_add_extra_location_widget (slot, slot->details->query_editor_revealer); slot->details->view_overlay = gtk_overlay_new (); gtk_widget_add_events (slot->details->view_overlay, |