r7076 - in bigboard/trunk/bigboard: . stocks/self themes
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7076 - in bigboard/trunk/bigboard: . stocks/self themes
- Date: Tue, 18 Dec 2007 11:59:39 -0600 (CST)
Author: walters
Date: 2007-12-18 11:59:38 -0600 (Tue, 18 Dec 2007)
New Revision: 7076
Modified:
bigboard/trunk/bigboard/slideout.py
bigboard/trunk/bigboard/stocks/self/SelfStock.py
bigboard/trunk/bigboard/themes/default.py
bigboard/trunk/bigboard/themes/fedora.py
Log:
Fix positioning of Self name.
Add themed border for slideouts.
Attempt to set opacity for slideouts, but no luck.
Modified: bigboard/trunk/bigboard/slideout.py
===================================================================
--- bigboard/trunk/bigboard/slideout.py 2007-12-18 16:30:53 UTC (rev 7075)
+++ bigboard/trunk/bigboard/slideout.py 2007-12-18 17:59:38 UTC (rev 7076)
@@ -4,7 +4,7 @@
import gobject
from bigboard.big_widgets import ThemedWidgetMixin
-logger = logging.getLogger('bigboard.Slideout')
+_logger = logging.getLogger('bigboard.Slideout')
class Slideout(hippo.CanvasWindow):
__gsignals__ = {
@@ -48,6 +48,7 @@
if offscreen_bottom > 0:
y = y - offscreen_bottom
self.move(x, y)
+ self._sync_preslideout_state()
self.present_with_time(gtk.get_current_event_time())
if self.__modal:
if not self.__do_grabs():
@@ -56,6 +57,9 @@
self.set_modal(True)
return True
+ def _sync_preslideout_state(self):
+ pass
+
def __do_grabs(self):
# owner_events=True says "only grab events going to other applications"; treat
# events going to this application normally; We need that because we want
@@ -94,8 +98,20 @@
class ThemedSlideout(Slideout, ThemedWidgetMixin):
def __init__(self, theme_hints=[], **kwargs):
Slideout.__init__(self, **kwargs)
- ThemedWidgetMixin.__init__(self, theme_hints=theme_hints)
+ ThemedWidgetMixin.__init__(self, theme_hints=theme_hints)
def _on_theme_changed(self, theme):
+ (width, color) = theme.slideout_border
+ self._root.set_property('border', width)
+ self._root.set_property('border-color', color)
self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#%6X" % (theme.background >> 8,)))
self.queue_draw_area(0,0,-1,-1)
+
+ def _sync_preslideout_state(self):
+ theme = self.get_theme()
+ if theme.have_compositing():
+ self.realize()
+ self.set_opacity(theme.opacity)
+ _logger.debug("have compositing, set opacity to %s", theme.opacity)
+ self.queue_draw_area(0,0,-1,-1)
+
\ No newline at end of file
Modified: bigboard/trunk/bigboard/stocks/self/SelfStock.py
===================================================================
--- bigboard/trunk/bigboard/stocks/self/SelfStock.py 2007-12-18 16:30:53 UTC (rev 7075)
+++ bigboard/trunk/bigboard/stocks/self/SelfStock.py 2007-12-18 17:59:38 UTC (rev 7076)
@@ -96,7 +96,7 @@
def __init__(self, stock, myself, fus=None, logger=None):
super(SelfSlideout, self).__init__()
- vbox = CanvasVBox(border=1, border_color=0x0000000ff, spacing=4, padding=4)
+ vbox = CanvasVBox(spacing=4, padding=4)
self.get_root().append(vbox)
self._logger = logger
@@ -115,9 +115,10 @@
self.__name = ThemedText(font="14px Bold",
xalign=hippo.ALIGNMENT_START,
+ yalign=hippo.ALIGNMENT_CENTER,
size_mode=hippo.CANVAS_SIZE_ELLIPSIZE_END)
- self.__personal_box_right.append(self.__name)
+ self.__personal_box_right.append(self.__name, hippo.PACK_EXPAND)
vbox.append(Separator())
Modified: bigboard/trunk/bigboard/themes/default.py
===================================================================
--- bigboard/trunk/bigboard/themes/default.py 2007-12-18 16:30:53 UTC (rev 7075)
+++ bigboard/trunk/bigboard/themes/default.py 2007-12-18 17:59:38 UTC (rev 7076)
@@ -1,6 +1,6 @@
import sys
-import hippo, cairo, pangocairo, pango
+import hippo, gtk, gobject, cairo, pangocairo, pango
from bigboard.libbig.singletonmixin import Singleton
from bigboard.big_widgets import ThemedWidgetMixin
@@ -9,12 +9,15 @@
def __init__(self):
super(DefaultTheme, self).__init__()
+ self.__compositing = gtk.gdk.display_get_default().supports_composite()
+
self.opacity = 0.85
self.background = 0xFFFFFFFF
self.prelight = 0xE2E2E2FF
self.foreground = 0x000000FF
self.subforeground = 0x666666FF
+ self.slideout_border = (1, 0xFFFFFFFF)
self.header_fg = self._rgba_to_cairo(self.foreground)
self.header_top = self._rgb_to_cairo(0x9EA3A5)
@@ -23,6 +26,9 @@
self.header_end = self._rgb_to_cairo(0xFFFFFF)
self.more_1 = self._rgb_to_cairo(0xFFFFFF)
self.more_2 = self._rgba_to_cairo(0xBBBFC299)
+
+ def have_compositing(self):
+ return self.__compositing
def _rgba_to_cairo(self, color):
return map(lambda c: c/255.0,
Modified: bigboard/trunk/bigboard/themes/fedora.py
===================================================================
--- bigboard/trunk/bigboard/themes/fedora.py 2007-12-18 16:30:53 UTC (rev 7075)
+++ bigboard/trunk/bigboard/themes/fedora.py 2007-12-18 17:59:38 UTC (rev 7076)
@@ -19,6 +19,8 @@
self.header_end = self._rgb_to_cairo(0x59809C)
self.header_bottom = self._rgba_to_cairo(0x244155FF)
self.prelight = 0x59809CFF
+ self.slideout_border = (1, 0xA2AFB5FF)
+
self.more_1 = self._rgb_to_cairo(0x496D87)
self.more_2 = self._rgba_to_cairo(0xA9BCCA99)
self.more_start = self._rgb_to_cairo(0x66859C)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]