r7003 - in bigboard/trunk: . bigboard bigboard/stocks/apps bigboard/themes
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7003 - in bigboard/trunk: . bigboard bigboard/stocks/apps bigboard/themes
- Date: Mon, 10 Dec 2007 13:26:00 -0600 (CST)
Author: walters
Date: 2007-12-10 13:26:00 -0600 (Mon, 10 Dec 2007)
New Revision: 7003
Modified:
bigboard/trunk/bigboard/big_widgets.py
bigboard/trunk/bigboard/stocks/apps/apps_widgets.py
bigboard/trunk/bigboard/themes/default.py
bigboard/trunk/bigboard/themes/fedora.py
bigboard/trunk/main.py
Log:
More theme updates.
Modified: bigboard/trunk/bigboard/big_widgets.py
===================================================================
--- bigboard/trunk/bigboard/big_widgets.py 2007-12-10 18:10:42 UTC (rev 7002)
+++ bigboard/trunk/bigboard/big_widgets.py 2007-12-10 19:26:00 UTC (rev 7003)
@@ -74,27 +74,31 @@
self.emit('theme-changed')
class ThemedWidgetMixin(object):
- def __init__(self):
+ def __init__(self, theme_hints=[]):
super(ThemedWidgetMixin, self).__init__()
mgr = ThemeManager.getInstance()
mgr.connect('theme-changed', self.__sync_theme)
+ self.__theme_hints = theme_hints
self.__sync_theme(mgr)
def get_theme(self):
return ThemeManager.getInstance().get_theme()
+
+ def get_theme_hints(self):
+ return self.__theme_hints
def __sync_theme(self, tm):
tm.get_theme().set_properties(self)
class ThemedText(hippo.CanvasText, ThemedWidgetMixin):
- def __init__(self, **kwargs):
+ def __init__(self, theme_hints=[], **kwargs):
super(ThemedText, self).__init__(**kwargs)
- ThemedWidgetMixin.__init__(self)
+ ThemedWidgetMixin.__init__(self, theme_hints=theme_hints)
class ThemedLink(hippo.CanvasLink, ThemedWidgetMixin):
- def __init__(self, **kwargs):
+ def __init__(self, theme_hints=[], **kwargs):
super(ThemedLink, self).__init__(**kwargs)
- ThemedWidgetMixin.__init__(self)
+ ThemedWidgetMixin.__init__(self, theme_hints=theme_hints)
class CanvasCheckbox(hippo.CanvasWidget):
def __init__(self, label):
Modified: bigboard/trunk/bigboard/stocks/apps/apps_widgets.py
===================================================================
--- bigboard/trunk/bigboard/stocks/apps/apps_widgets.py 2007-12-10 18:10:42 UTC (rev 7002)
+++ bigboard/trunk/bigboard/stocks/apps/apps_widgets.py 2007-12-10 19:26:00 UTC (rev 7003)
@@ -5,7 +5,7 @@
import bigboard.globals as globals
import bigboard.apps_directory as apps_directory
-from bigboard.big_widgets import CanvasMugshotURLImage, PhotoContentItem, CanvasHBox, CanvasVBox, ActionLink
+from bigboard.big_widgets import CanvasMugshotURLImage, PhotoContentItem, CanvasHBox, CanvasVBox, ActionLink, ThemedText
class AppLocation:
(STOCK, APP_BROWSER, DESCRIPTION_HEADER) = range(3)
@@ -31,11 +31,8 @@
self.__title = ActionLink(font="14px",xalign=hippo.ALIGNMENT_START, size_mode=hippo.CANVAS_SIZE_ELLIPSIZE_END, **sub_kwargs)
self.__title.connect("activated", lambda t: self.emit("title-clicked"))
- self.__subtitle = hippo.CanvasText(font="10px",xalign=hippo.ALIGNMENT_START, size_mode=hippo.CANVAS_SIZE_ELLIPSIZE_END)
-
- attrs = pango.AttrList()
- attrs.insert(pango.AttrForeground(0x6666, 0x6666, 0x6666, 0, 0xFFFF))
- self.__subtitle.set_property("attributes", attrs)
+ self.__subtitle = ThemedText(theme_hints=['subforeground'], font="10px",xalign=hippo.ALIGNMENT_START, size_mode=hippo.CANVAS_SIZE_ELLIPSIZE_END)
+
self.__box.append(self.__title)
self.__box.append(self.__subtitle)
self.set_child(self.__box)
Modified: bigboard/trunk/bigboard/themes/default.py
===================================================================
--- bigboard/trunk/bigboard/themes/default.py 2007-12-10 18:10:42 UTC (rev 7002)
+++ bigboard/trunk/bigboard/themes/default.py 2007-12-10 19:26:00 UTC (rev 7003)
@@ -9,6 +9,7 @@
super(DefaultTheme, self).__init__()
self.background = 0xFFFFFFFF
self.foreground = 0x000000FF
+ self.subforeground = 0x666666FF
self.header_start = 0xF4F4F4FF
self.header_end = 0xC7C7C7FF
@@ -20,7 +21,11 @@
def set_properties(self, widget):
if isinstance(widget, hippo.CanvasText) or \
isinstance(widget, hippo.CanvasLink):
- widget.set_properties(color=self.foreground)
+ hints = widget.get_theme_hints()
+ if 'subforeground' in hints:
+ widget.set_properties(color=self.subforeground)
+ else:
+ widget.set_properties(color=self.foreground)
def getInstance():
return DefaultTheme.getInstance()
\ No newline at end of file
Modified: bigboard/trunk/bigboard/themes/fedora.py
===================================================================
--- bigboard/trunk/bigboard/themes/fedora.py 2007-12-10 18:10:42 UTC (rev 7002)
+++ bigboard/trunk/bigboard/themes/fedora.py 2007-12-10 19:26:00 UTC (rev 7003)
@@ -8,6 +8,7 @@
super(FedoraTheme, self).__init__()
self.background = 0x345B75FF
self.foreground = 0xFFFFFFFF
+ self.subforeground = 0x95A9B6FF
self.header_start = 0x436A85FF
self.header_end = 0x59809CFF
Modified: bigboard/trunk/main.py
===================================================================
--- bigboard/trunk/main.py 2007-12-10 18:10:42 UTC (rev 7002)
+++ bigboard/trunk/main.py 2007-12-10 19:26:00 UTC (rev 7003)
@@ -18,7 +18,7 @@
import bigboard
import bigboard.big_widgets
-from bigboard.big_widgets import Sidebar, CanvasHBox, CanvasVBox, ActionLink
+from bigboard.big_widgets import Sidebar, CanvasHBox, CanvasVBox, ActionLink, ThemedText
from bigboard.big_widgets import Button, GradientHeader, ThemedWidgetMixin, ThemeManager
from bigboard.stock import Stock
import bigboard.libbig
@@ -277,8 +277,9 @@
class ThemedGradient(hippo.CanvasGradient, ThemedWidgetMixin):
def __init__(self):
- super(ThemedGradient, self).__init__()
+ super(ThemedGradient, self).__init__(orientation=hippo.ORIENTATION_HORIZONTAL)
self._on_theme_change()
+
def _on_theme_change(self, *args):
theme = self.get_theme()
_logger.debug("changing gradient %s %s", theme.header_start, theme.header_end)
@@ -305,7 +306,7 @@
self.__expanded = True
if not is_notitle:
self.__ticker_container = ThemedGradient()
- self.__ticker_text = hippo.CanvasText(text=metainfo.title, font="14px", xalign=hippo.ALIGNMENT_START)
+ self.__ticker_text = ThemedText(text=metainfo.title, font="14px", xalign=hippo.ALIGNMENT_START)
self.__ticker_text.connect("button-press-event", lambda text, event: self.__toggle_expanded())
self.__ticker_container.append(self.__ticker_text, hippo.PACK_EXPAND)
@@ -414,7 +415,7 @@
self._main_box = hippo.CanvasBox(border_right=1, border_color=0x999999FF, padding_bottom=4)
self._canvas.set_root(self._main_box)
- self._header_box = GradientHeader()
+ self._header_box = ThemedGradient()
self._header_box.connect("button-press-event", self.__on_header_buttonpress)
self.__unpopout_button = Button(label='Hide', label_ypadding=-2)
@@ -422,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 = hippo.CanvasText(text="My Desktop", font="Bold 14px", xalign=hippo.ALIGNMENT_START)
+ self._title = ThemedText(text="My Desktop", font="Bold 14px", xalign=hippo.ALIGNMENT_START)
self._header_box.append(self._title, hippo.PACK_EXPAND)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]