r6868 - bigboard/trunk



Author: hp
Date: 2007-11-02 15:20:47 -0500 (Fri, 02 Nov 2007)
New Revision: 6868

Modified:
   bigboard/trunk/main.py
Log:
add an ugly "Hide" button if the sidebar can be hidden

Modified: bigboard/trunk/main.py
===================================================================
--- bigboard/trunk/main.py	2007-11-02 20:00:08 UTC (rev 6867)
+++ bigboard/trunk/main.py	2007-11-02 20:20:47 UTC (rev 6868)
@@ -405,7 +405,12 @@
         self._canvas.set_root(self._main_box)
      
         self._header_box = GradientHeader()
-        self._header_box.connect("button-press-event", self.__on_header_buttonpress)     
+        self._header_box.connect("button-press-event", self.__on_header_buttonpress)             
+
+        self.__unpopout_button = Button(label='Hide', label_ypadding=-2)
+        self.__unpopout_button.set_property('yalign', hippo.ALIGNMENT_CENTER)
+        self.__unpopout_button.connect("activated", lambda button: self.__do_unpopout())
+        self._header_box.append(self.__unpopout_button, hippo.PACK_END)
      
         self._title = hippo.CanvasText(text="My Desktop", font="Bold 14px", xalign=hippo.ALIGNMENT_START)
      
@@ -571,6 +576,7 @@
     def __enter_popped_out_state(self):
         if not self.__popped_out:
             _logger.debug("popping out")
+
             self._dw.show()
             # we would prefer to need this, if iconify() worked on dock windows
             #self._dw.deiconify()
@@ -609,6 +615,11 @@
     @log_except()
     def __sync_visible_mode(self, *args):
         vis = gconf.client_get_default().get_bool(GCONF_PREFIX + 'visible')
+
+        ## unpopout button is only visible if unpopout is allowed
+        vis = gconf.client_get_default().get_bool(GCONF_PREFIX + 'visible')
+        self.__unpopout_button.set_visible(not vis)
+        
         if vis and not self.__popped_out:
             self.__enter_popped_out_state()
         elif not vis:



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