r7001 - in bigboard/trunk: bigboard bigboard/themes data
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7001 - in bigboard/trunk: bigboard bigboard/themes data
- Date: Mon, 10 Dec 2007 11:52:24 -0600 (CST)
Author: walters
Date: 2007-12-10 11:52:23 -0600 (Mon, 10 Dec 2007)
New Revision: 7001
Modified:
bigboard/trunk/bigboard/big_widgets.py
bigboard/trunk/bigboard/themes/default.py
bigboard/trunk/data/Makefile.am
bigboard/trunk/data/bigboard-bulb-bw.png
bigboard/trunk/data/bigboard-bulb.png
Log:
Redo theming architecture a bit; make bulb background transparent.
Modified: bigboard/trunk/bigboard/big_widgets.py
===================================================================
--- bigboard/trunk/bigboard/big_widgets.py 2007-12-10 17:40:49 UTC (rev 7000)
+++ bigboard/trunk/bigboard/big_widgets.py 2007-12-10 17:52:23 UTC (rev 7001)
@@ -77,29 +77,24 @@
def __init__(self):
super(ThemedWidgetMixin, self).__init__()
mgr = ThemeManager.getInstance()
- self.__boundprops = {}
mgr.connect('theme-changed', self.__sync_theme)
+ self.__sync_theme(mgr)
def get_theme(self):
return ThemeManager.getInstance().get_theme()
- def _theme_bind(self, bindings):
- self.__boundprops.update(bindings)
- self._on_theme_change(ThemeManager.getInstance())
-
- def _on_theme_change(self, tm):
- print "tc, bindings: %s" % (self.__boundprops)
- for binding,func in self.__boundprops.iteritems():
- self.set_property(binding, func(tm.get_theme()))
-
def __sync_theme(self, tm):
- self._on_theme_change(tm)
+ tm.get_theme().set_properties(self)
class ThemedText(hippo.CanvasText, ThemedWidgetMixin):
def __init__(self, **kwargs):
super(ThemedText, self).__init__(**kwargs)
ThemedWidgetMixin.__init__(self)
- self._theme_bind({'color': lambda t: t.foreground})
+
+class ThemedLink(hippo.CanvasLink, ThemedWidgetMixin):
+ def __init__(self, **kwargs):
+ super(ThemedLink, self).__init__(**kwargs)
+ ThemedWidgetMixin.__init__(self)
class CanvasCheckbox(hippo.CanvasWidget):
def __init__(self, label):
@@ -133,11 +128,12 @@
padding_left=4,
color=0x333333FF, **kwargs)
-class ActionLink(hippo.CanvasLink):
+class ActionLink(hippo.CanvasLink, ThemedWidgetMixin):
def __init__(self, underline=pango.UNDERLINE_NONE, **kwargs):
if not kwargs.has_key('color'):
kwargs['color'] = 0x0066DDFF
hippo.CanvasLink.__init__(self, **kwargs)
+ ThemedWidgetMixin.__init__(self)
self.set_underline(underline)
def set_underline(self, underline):
Modified: bigboard/trunk/bigboard/themes/default.py
===================================================================
--- bigboard/trunk/bigboard/themes/default.py 2007-12-10 17:40:49 UTC (rev 7000)
+++ bigboard/trunk/bigboard/themes/default.py 2007-12-10 17:52:23 UTC (rev 7001)
@@ -1,4 +1,7 @@
+import sys
+import hippo
+
from bigboard.libbig.singletonmixin import Singleton
class DefaultTheme(Singleton):
@@ -14,5 +17,10 @@
cr.rectangle(area.x, area.y, area.width, area.height)
cr.fill()
+ def set_properties(self, widget):
+ if isinstance(widget, hippo.CanvasText) or \
+ isinstance(widget, hippo.CanvasLink):
+ widget.set_properties(color=self.foreground)
+
def getInstance():
return DefaultTheme.getInstance()
\ No newline at end of file
Modified: bigboard/trunk/data/Makefile.am
===================================================================
--- bigboard/trunk/data/Makefile.am 2007-12-10 17:40:49 UTC (rev 7000)
+++ bigboard/trunk/data/Makefile.am 2007-12-10 17:52:23 UTC (rev 7001)
@@ -1,8 +1,5 @@
icon_DATA = bigboard-bulb.png bigboard-bulb-bw.png bigboard-collapse.png bigboard-document.png bigboard-down-arrow-disabled.png bigboard-down-arrow-enabled.png bigboard-expand.png bigboard-left-button.png bigboard-music.png bigboard-presentation.png bigboard-right-button.png bigboard-spreadsheet.png bigboard-today-disabled.png bigboard-today-enabled.png bigboard-up-arrow-disabled.png bigboard-up-arrow-enabled.png windows_key.png ctrl_esc_keys.png
icondir = $(datadir)/bigboard
-theme_DATA = theme-fedora.xml
-themedir = $(datadir)/bigboard
+EXTRA_DIST= $(icon_DATA)
-EXTRA_DIST= $(icon_DATA) $(theme_DATA)
-
Modified: bigboard/trunk/data/bigboard-bulb-bw.png
===================================================================
(Binary files differ)
Modified: bigboard/trunk/data/bigboard-bulb.png
===================================================================
(Binary files differ)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]