r7030 - in bigboard/trunk: . bigboard bigboard/themes
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7030 - in bigboard/trunk: . bigboard bigboard/themes
- Date: Tue, 11 Dec 2007 16:46:13 -0600 (CST)
Author: walters
Date: 2007-12-11 16:46:13 -0600 (Tue, 11 Dec 2007)
New Revision: 7030
Modified:
bigboard/trunk/bigboard.schemas.in
bigboard/trunk/bigboard/big_widgets.py
bigboard/trunk/bigboard/themes/default.py
bigboard/trunk/bigboard/themes/fedora.py
bigboard/trunk/main.py
Log:
More theme updates.
Change default theme to "default".
Draw header using custom cario code.
Modified: bigboard/trunk/bigboard/big_widgets.py
===================================================================
--- bigboard/trunk/bigboard/big_widgets.py 2007-12-11 22:38:15 UTC (rev 7029)
+++ bigboard/trunk/bigboard/big_widgets.py 2007-12-11 22:46:13 UTC (rev 7030)
@@ -88,7 +88,7 @@
return self.__theme_hints
def _on_theme_changed(self, theme):
- pass
+ self.emit_paint_needed(0,0,-1,-1)
def __sync_theme(self, tm):
theme = tm.get_theme()
Modified: bigboard/trunk/bigboard/themes/default.py
===================================================================
--- bigboard/trunk/bigboard/themes/default.py 2007-12-11 22:38:15 UTC (rev 7029)
+++ bigboard/trunk/bigboard/themes/default.py 2007-12-11 22:46:13 UTC (rev 7030)
@@ -1,6 +1,6 @@
import sys
-import hippo
+import hippo, cairo
from bigboard.libbig.singletonmixin import Singleton
@@ -11,13 +11,41 @@
self.prelight = 0xE2E2E2FF
self.foreground = 0x000000FF
self.subforeground = 0x666666FF
- self.header_start = 0xF4F4F4FF
- self.header_end = 0xC7C7C7FF
+ self.header_top = self._rgba_to_cairo(self.foreground)
+ self.header_start = self._rgb_to_cairo(0xC7C7C7)
+ self.header_end = self._rgb_to_cairo(0xF4F4F4)
+ self.header_bottom = self._rgba_to_cairo(self.foreground)
+
+ def _rgba_to_cairo(self, color):
+ return map(lambda c: c/255.0,
+ ((color & 0xFF000000) >> 24,
+ (color & 0x00FF0000) >> 16,
+ (color & 0x0000FF00) >> 8,
+ (color & 0x000000FF) >> 0))
+
+ def _rgb_to_cairo(self, color):
+ return map(lambda c: c/255.0,
+ ((color & 0x00FF0000) >> 16,
+ (color & 0x0000FF00) >> 8,
+ (color & 0x000000FF) >> 0))
+
def draw_header(self, cr, area):
- cr.set_source_rgb(1.0, 1.0, 1.0)
- cr.rectangle(area.x, area.y, area.width, area.height)
+ cr.set_source_rgba(*self.header_top)
+ cr.rectangle(area.x, area.y, area.width, 1)
cr.fill()
+ gradient_y_start = area.y+1
+ gradient_y_height = gradient_y_start+area.height-1
+ pat = cairo.LinearGradient(area.x, gradient_y_start,
+ area.x, gradient_y_height)
+ pat.add_color_stop_rgb(0.0, *self.header_start)
+ pat.add_color_stop_rgb(1.0, *self.header_end)
+ cr.set_source(pat)
+ cr.rectangle(area.x, gradient_y_start, area.width, gradient_y_height)
+ cr.fill()
+ cr.set_source_rgba(*self.header_bottom)
+ cr.rectangle(area.x, gradient_y_height, area.width, 1)
+ cr.fill()
def set_properties(self, widget):
if isinstance(widget, hippo.CanvasText) or \
Modified: bigboard/trunk/bigboard/themes/fedora.py
===================================================================
--- bigboard/trunk/bigboard/themes/fedora.py 2007-12-11 22:38:15 UTC (rev 7029)
+++ bigboard/trunk/bigboard/themes/fedora.py 2007-12-11 22:46:13 UTC (rev 7030)
@@ -1,3 +1,4 @@
+import os,sys
import gtk
@@ -8,15 +9,12 @@
super(FedoraTheme, self).__init__()
self.background = 0x345B75FF
self.foreground = 0xFFFFFFFF
- self.subforeground = 0x95A9B6FF
- self.header_start = 0x436A85FF
- self.header_end = 0x59809CFF
- self.prelight = self.header_end
+ self.subforeground = 0x95A9B6FF
+ self.header_top = self._rgba_to_cairo(0xCBD5DCFF)
+ self.header_start = self._rgb_to_cairo(0x436A85)
+ self.header_end = self._rgb_to_cairo(0x59809C)
+ self.header_bottom = self._rgba_to_cairo(0x244155FF)
+ self.prelight = 0x59809CFF
- def draw_header(self, cr, area):
- cr.set_source_rgb(1.0, 1.0, 1.0)
- cr.rectangle(area.x, area.y, area.width, area.height)
- cr.fill()
-
def getInstance():
return FedoraTheme.getInstance()
\ No newline at end of file
Modified: bigboard/trunk/bigboard.schemas.in
===================================================================
--- bigboard/trunk/bigboard.schemas.in 2007-12-11 22:38:15 UTC (rev 7029)
+++ bigboard/trunk/bigboard.schemas.in 2007-12-11 22:46:13 UTC (rev 7030)
@@ -6,7 +6,7 @@
<applyto>/apps/bigboard/theme</applyto>
<owner>bigboard</owner>
<type>string</type>
- <default>fedora</default>
+ <default>default</default>
<locale name="C">
<short>Graphical theme used for display</short>
</locale>
Modified: bigboard/trunk/main.py
===================================================================
--- bigboard/trunk/main.py 2007-12-11 22:38:15 UTC (rev 7029)
+++ bigboard/trunk/main.py 2007-12-11 22:46:13 UTC (rev 7030)
@@ -275,16 +275,15 @@
self.widget.show_all()
self.set_property('widget', self.widget)
-class ThemedGradient(hippo.CanvasGradient, ThemedWidgetMixin):
+class ThemedGradient(hippo.CanvasBox, ThemedWidgetMixin):
def __init__(self):
- super(ThemedGradient, self).__init__(orientation=hippo.ORIENTATION_HORIZONTAL)
- self._on_theme_change()
+ super(ThemedGradient, self).__init__(orientation=hippo.ORIENTATION_HORIZONTAL,
+ background_color=0xFF0000FF)
- def _on_theme_change(self, *args):
- theme = self.get_theme()
- _logger.debug("changing gradient %s %s", theme.header_start, theme.header_end)
- self.set_property('start-color', theme.header_start)
- self.set_property('end-color', theme.header_end)
+ def do_paint_below_children(self, cr, dmgbox):
+ area = self.get_background_area()
+ self.get_theme().draw_header(cr, area)
+gobject.type_register(ThemedGradient)
class Exchange(hippo.CanvasBox, ThemedWidgetMixin):
"""A renderer for stocks."""
@@ -570,6 +569,7 @@
def __sync_theme(self, *args):
theme = self.__theme_mgr.get_theme()
self._canvas.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#%6X" % (theme.background >> 8,)))
+ self._canvas.queue_draw_area(0,0,-1,-1)
def get_theme(self):
return self.__theme
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]