r7004 - in bigboard/trunk: . bigboard bigboard/themes



Author: walters
Date: 2007-12-10 14:48:23 -0600 (Mon, 10 Dec 2007)
New Revision: 7004

Modified:
   bigboard/trunk/bigboard/big_widgets.py
   bigboard/trunk/bigboard/themes/default.py
   bigboard/trunk/bigboard/themes/fedora.py
   bigboard/trunk/main.py
Log:
Fix up some spacing, prelighting, bolding.



Modified: bigboard/trunk/bigboard/big_widgets.py
===================================================================
--- bigboard/trunk/bigboard/big_widgets.py	2007-12-10 19:26:00 UTC (rev 7003)
+++ bigboard/trunk/bigboard/big_widgets.py	2007-12-10 20:48:23 UTC (rev 7004)
@@ -86,9 +86,14 @@
     
     def get_theme_hints(self):
         return self.__theme_hints
+    
+    def _on_theme_changed(self, theme):
+        pass
 
     def __sync_theme(self, tm):
-        tm.get_theme().set_properties(self)             
+        theme = tm.get_theme()
+        theme.set_properties(self)
+        self._on_theme_changed(theme)             
         
 class ThemedText(hippo.CanvasText, ThemedWidgetMixin):
     def __init__(self, theme_hints=[], **kwargs):
@@ -275,13 +280,14 @@
     def __init__(self):
         hippo.CanvasBox.__init__(self, border_top=1, border_color=0x999999FF, padding_left=6, padding_right=6)
 
-class PrelightingCanvasBox(hippo.CanvasBox):
+class PrelightingCanvasBox(hippo.CanvasBox, ThemedWidgetMixin):
     """A box with a background that changes color on mouse hover."""
     def __init__(self, **kwargs):
-        hippo.CanvasBox.__init__(self, **kwargs)
         self.__hovered = False
         self.__force_prelight = False
-        self._prelighted = False
+        self._prelighted = False        
+        hippo.CanvasBox.__init__(self, **kwargs)
+        ThemedWidgetMixin.__init__(self)
         self.connect('motion-notify-event', lambda self, event: self.__handle_motion(event))
         
     def __handle_motion(self, event):
@@ -296,13 +302,16 @@
         self.__force_prelight = force
         self.sync_prelight_color()
         
+    def _on_theme_changed(self, theme):
+        self.sync_prelight_color()
+
     # protected
     def sync_prelight_color(self): 
         if self.__force_prelight or (self.__hovered and self.do_prelight()):
-            self.set_property('background-color', 0xE2E2E2FF)
+            self.set_property('background-color', self.get_theme().prelight)
             self._prelighted = True
         else:
-            self.set_property('background-color', 0x00000000)           
+            self.set_property('background-color', self.get_theme().background)
             self._prelighted = False
             
     # protected
@@ -316,14 +325,15 @@
     def __init__(self, **kwargs):
         if 'spacing' not in kwargs:
             kwargs['spacing'] = 4
-        PrelightingCanvasBox.__init__(self,
-                                      orientation=hippo.ORIENTATION_HORIZONTAL,
-                                      **kwargs)
         self.__photo = None
         self.__photo_native_width = None
         self.__photo_native_height = None
         self.__child = None
-        self.__cb = None
+        self.__cb = None            
+        PrelightingCanvasBox.__init__(self,
+                                      orientation=hippo.ORIENTATION_HORIZONTAL,
+                                      **kwargs)
+
         
     def set_photo(self, photo):
         assert(self.__photo is None)

Modified: bigboard/trunk/bigboard/themes/default.py
===================================================================
--- bigboard/trunk/bigboard/themes/default.py	2007-12-10 19:26:00 UTC (rev 7003)
+++ bigboard/trunk/bigboard/themes/default.py	2007-12-10 20:48:23 UTC (rev 7004)
@@ -8,6 +8,7 @@
     def __init__(self):
         super(DefaultTheme, self).__init__()
         self.background = 0xFFFFFFFF
+        self.prelight = 0xE2E2E2FF
         self.foreground = 0x000000FF
         self.subforeground = 0x666666FF
         self.header_start = 0xF4F4F4FF

Modified: bigboard/trunk/bigboard/themes/fedora.py
===================================================================
--- bigboard/trunk/bigboard/themes/fedora.py	2007-12-10 19:26:00 UTC (rev 7003)
+++ bigboard/trunk/bigboard/themes/fedora.py	2007-12-10 20:48:23 UTC (rev 7004)
@@ -6,11 +6,12 @@
 class FedoraTheme(DefaultTheme):
     def __init__(self):
         super(FedoraTheme, self).__init__()
-        self.background = 0x345B75FF
+        self.background = 0x345B75FF  
         self.foreground = 0xFFFFFFFF
         self.subforeground = 0x95A9B6FF        
         self.header_start = 0x436A85FF
         self.header_end = 0x59809CFF
+        self.prelight = self.header_end        
         
     def draw_header(self, cr, area):
         cr.set_source_rgb(1.0, 1.0, 1.0)

Modified: bigboard/trunk/main.py
===================================================================
--- bigboard/trunk/main.py	2007-12-10 19:26:00 UTC (rev 7003)
+++ bigboard/trunk/main.py	2007-12-10 20:48:23 UTC (rev 7004)
@@ -306,7 +306,7 @@
         self.__expanded = True
         if not is_notitle:
             self.__ticker_container = ThemedGradient()
-            self.__ticker_text = ThemedText(text=metainfo.title, font="14px", xalign=hippo.ALIGNMENT_START)
+            self.__ticker_text = ThemedText(text=metainfo.title, font="14px Bold", xalign=hippo.ALIGNMENT_START, padding_left=8)
             self.__ticker_text.connect("button-press-event", lambda text, event: self.__toggle_expanded())  
             self.__ticker_container.append(self.__ticker_text, hippo.PACK_EXPAND)
             
@@ -423,7 +423,7 @@
         self.__unpopout_button.connect("activated", lambda button: self.__do_unpopout())
         self._header_box.append(self.__unpopout_button, hippo.PACK_END)
      
-        self._title = ThemedText(text="My Desktop", font="Bold 14px", xalign=hippo.ALIGNMENT_START)
+        self._title = ThemedText(text="My Desktop", font="Bold 14px", xalign=hippo.ALIGNMENT_START, padding_left=8)
      
         self._header_box.append(self._title, hippo.PACK_EXPAND)
         



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