deskbar-applet r2035 - in trunk: . deskbar/ui



Author: sebp
Date: Fri Mar 21 12:05:38 2008
New Revision: 2035
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2035&view=rev

Log:
Mark empty button insensitive when history contains no items.

Modified:
   trunk/ChangeLog
   trunk/deskbar/ui/CuemiacAlignedView.py
   trunk/deskbar/ui/CuemiacWindowView.py

Modified: trunk/deskbar/ui/CuemiacAlignedView.py
==============================================================================
--- trunk/deskbar/ui/CuemiacAlignedView.py	(original)
+++ trunk/deskbar/ui/CuemiacAlignedView.py	Fri Mar 21 12:05:38 2008
@@ -92,11 +92,11 @@
         self.history_box.pack_start(self.hview)
         hlabel.set_mnemonic_widget(self.hview)
         
-        empty_button = gtk.Button()
-        empty_button.set_image( gtk.image_new_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_MENU) )
-        empty_button.connect("clicked", self._controller.on_clear_history)
-        empty_button.show()
-        self.history_box.pack_start(empty_button, False)
+        self.empty_button = gtk.Button()
+        self.empty_button.set_image( gtk.image_new_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_MENU) )
+        self.empty_button.connect("clicked", self._controller.on_clear_history)
+        self.empty_button.show()
+        self.history_box.pack_start(self.empty_button, False)
         
         # Results TreeView
         self.treeview_model = CuemiacModel ()
@@ -196,10 +196,8 @@
         self.entry.grab_focus()
         
     def mark_history_empty(self, val):
-        if val:
-            self.hview.set_sensitive (False)
-        else:
-            self.hview.set_sensitive (True)
+        self.hview.set_sensitive (not val)
+        self.empty_button.set_sensitive (not val)
         
     def __show_matches(self):
         self.scrolled_results.show()

Modified: trunk/deskbar/ui/CuemiacWindowView.py
==============================================================================
--- trunk/deskbar/ui/CuemiacWindowView.py	(original)
+++ trunk/deskbar/ui/CuemiacWindowView.py	Fri Mar 21 12:05:38 2008
@@ -84,11 +84,11 @@
         hhbox.pack_start(self.hview)
         hlabel.set_mnemonic_widget(self.hview)
         
-        empty_button = gtk.Button()
-        empty_button.set_image( gtk.image_new_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_MENU) )
-        empty_button.connect("clicked", self._controller.on_clear_history)
-        empty_button.show()
-        hhbox.pack_start(empty_button, False)
+        self.empty_button = gtk.Button()
+        self.empty_button.set_image( gtk.image_new_from_stock(gtk.STOCK_CLEAR, gtk.ICON_SIZE_MENU) )
+        self.empty_button.connect("clicked", self._controller.on_clear_history)
+        self.empty_button.show()
+        hhbox.pack_start(self.empty_button, False)
         
         # Results TreeView
         self.treeview_model = CuemiacModel ()
@@ -189,10 +189,8 @@
         self.move( self._model.get_window_x(), self._model.get_window_y() )
         
     def mark_history_empty(self, val):
-        if val:
-            self.hview.set_sensitive (False)
-        else:
-            self.hview.set_sensitive (True)
+        self.hview.set_sensitive (not val)
+        self.empty_button.set_sensitive (not val)
         
     def __show_matches(self):
         self.scrolled_results.show()



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