[gnome-music/freeze-break: 52/107] window: Show/hide search bar when search button is toggled



commit b61bba0e8d053923c82f2487c1d964d0abd7017a
Author: Arnel A. Borja <arnelborja src gnome org>
Date:   Sun Sep 8 20:26:33 2013 +0800

    window: Show/hide search bar when search button is toggled

 gnomemusic/window.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gnomemusic/window.py b/gnomemusic/window.py
index a34266c..3385e40 100644
--- a/gnomemusic/window.py
+++ b/gnomemusic/window.py
@@ -137,6 +137,8 @@ class Window(Gtk.ApplicationWindow):
             self.views.append(Views.Empty(self.toolbar, self.player))
             self._stack.add_titled(self.views[0], _("Empty"), _("Empty"))
 
+        self.toolbar._search_button.connect('toggled', self._on_search_toggled)
+
         self.toolbar.set_state(ToolbarState.ALBUMS)
         self.toolbar.header_bar.show()
         self.player.eventBox.show_all()
@@ -164,8 +166,12 @@ class Window(Gtk.ApplicationWindow):
     def _toggle_view(self, btn, i):
         self._stack.set_visible_child(self.views[i])
 
+    def _on_search_toggled(self, button, data=None):
+        self._show_searchbar(button.get_active())
+
     def _show_searchbar(self, show):
         self.toolbar.searchbar.set_reveal_child(show)
+        self.toolbar._search_button.set_active(show)
         if show:
             self.toolbar.searchbar._search_entry.grab_focus()
         else:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]