r7068 - in bigboard/trunk: . bigboard bigboard/stocks/files bigboard/themes
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7068 - in bigboard/trunk: . bigboard bigboard/stocks/files bigboard/themes
- Date: Fri, 14 Dec 2007 17:55:37 -0600 (CST)
Author: walters
Date: 2007-12-14 17:55:36 -0600 (Fri, 14 Dec 2007)
New Revision: 7068
Modified:
bigboard/trunk/bigboard/big_widgets.py
bigboard/trunk/bigboard/libgimmie.py
bigboard/trunk/bigboard/stocks/files/FilesStock.py
bigboard/trunk/bigboard/themes/default.py
bigboard/trunk/bigboard/themes/fedora.py
bigboard/trunk/main.py
Log:
Various appearance fixes, and one --replace bugfix.
Attempt to theme file stock slideout, not done yet.
Use toplevel opacity if compositing is available.
Add nonworking commented-out code to try to do something fancier.
Modified: bigboard/trunk/bigboard/big_widgets.py
===================================================================
--- bigboard/trunk/bigboard/big_widgets.py 2007-12-14 23:52:16 UTC (rev 7067)
+++ bigboard/trunk/bigboard/big_widgets.py 2007-12-14 23:55:36 UTC (rev 7068)
@@ -126,8 +126,17 @@
def set_row_expand(self, row, expand):
self.__layout.set_row_expand(row, expand)
-
+class Header(hippo.CanvasBox, ThemedWidgetMixin):
+ def __init__(self):
+ super(Header, self).__init__(orientation=hippo.ORIENTATION_HORIZONTAL,
+ background_color=0xFF0000FF)
+
+ def do_paint_below_children(self, cr, dmgbox):
+ area = self.get_background_area()
+ self.get_theme().draw_header(cr, area)
+gobject.type_register(Header)
+
class GradientHeader(hippo.CanvasGradient):
def __init__(self, **kwargs):
hippo.CanvasGradient.__init__(self,
Modified: bigboard/trunk/bigboard/libgimmie.py
===================================================================
--- bigboard/trunk/bigboard/libgimmie.py 2007-12-14 23:52:16 UTC (rev 7067)
+++ bigboard/trunk/bigboard/libgimmie.py 2007-12-14 23:55:36 UTC (rev 7068)
@@ -35,17 +35,20 @@
self.content = gtk.HBox (False, 0)
self.content.show()
+ self.content_window = gtk.EventBox()
self.content_align = gtk.Alignment(xscale=1.0, yscale=1.0)
self.content_align.add(self.content)
self.content_align.show()
- self.add(self.content_align)
+ self.content_window.add(self.content_align)
+ self.content_window.show()
+ self.add(self.content_window)
def get_content(self):
return self.content
+
+ def get_content_window(self):
+ return self.content_window
- def get_content_alignment(self):
- return self.content_align
-
def get_edge_gravity(self):
return self.edge_gravity
Modified: bigboard/trunk/bigboard/stocks/files/FilesStock.py
===================================================================
--- bigboard/trunk/bigboard/stocks/files/FilesStock.py 2007-12-14 23:52:16 UTC (rev 7067)
+++ bigboard/trunk/bigboard/stocks/files/FilesStock.py 2007-12-14 23:55:36 UTC (rev 7068)
@@ -14,10 +14,10 @@
from bigboard.libbig.gutil import *
from bigboard.workboard import WorkBoard
from bigboard.stock import Stock
-from bigboard.slideout import Slideout
+from bigboard.slideout import ThemedSlideout
import bigboard.google as google
import bigboard.google_stock as google_stock
-from bigboard.big_widgets import IconLink, CanvasHBox, CanvasVBox, Button, GradientHeader
+from bigboard.big_widgets import IconLink, CanvasHBox, CanvasVBox, Button, Header, ThemedText
from bigboard.libbig.xmlquery import query as xml_query, get_attrs as xml_get_attrs
import bigboard.apps_directory as apps_directory
import bigboard.search as search
@@ -274,12 +274,12 @@
return None
return pixbuf
-class FileSlideout(Slideout):
+class FileSlideout(ThemedSlideout):
def __init__(self, fobj):
super(FileSlideout, self).__init__()
vbox = CanvasVBox(border=1, border_color=0x0000000ff, spacing=4, padding=4)
self.get_root().append(vbox)
- self.__header = GradientHeader()
+ self.__header = Header()
text = hippo.CanvasText(text=fobj.get_name(), font="14px", xalign=hippo.ALIGNMENT_START)
self.__header.append(text, hippo.PACK_EXPAND)
vbox.append(self.__header)
@@ -291,20 +291,16 @@
vbox.append(hbox)
detailvbox = CanvasVBox(spacing=3)
- hbox.append(detailvbox)
- attrs = pango.AttrList()
- attrs.insert(pango.AttrForeground(0x6666, 0x6666, 0x6666, 0, 0xFFFF))
+ hbox.append(detailvbox)
mime = fobj.get_mimetype()
if mime:
mimename = gnomevfs.mime_get_description(mime)
- text = hippo.CanvasText(text=mimename, font='12px', xalign=hippo.ALIGNMENT_START)
- text.set_property("attributes", attrs)
+ text = ThemedText(theme_hints=['subforeground'], text=mimename, font='12px', xalign=hippo.ALIGNMENT_START)
detailvbox.append(text)
size = fobj.get_size()
if size is not None:
sizestr = format_file_size(size)
- text = hippo.CanvasText(text=sizestr, font='12px', xalign=hippo.ALIGNMENT_START)
- text.set_property("attributes", attrs)
+ text = ThemedText(theme_hints=['subforeground'], text=sizestr, font='12px', xalign=hippo.ALIGNMENT_START)
detailvbox.append(text)
fname = os.path.dirname(fobj.get_full_name())
if fname.startswith('file://'):
@@ -313,12 +309,11 @@
if fname.startswith(home):
fname = fname[:len(home)]
fname = urllib.unquote(fname)
- text = hippo.CanvasText(text=fname, font='12px', xalign=hippo.ALIGNMENT_START)
- text.set_property("attributes", attrs)
+ text = ThemedText(theme_hints=['subforeground'], text=fname, font='12px', xalign=hippo.ALIGNMENT_START)
detailvbox.append(text)
apps = gnomevfs.mime_get_all_applications(mime)
if apps:
- text = hippo.CanvasText(text='Open With: ', font='14px')
+ text = ThemedText(text='Open With: ', font='14px')
detailvbox.append(text)
def on_app_clicked(button, app):
self.emit('close', True)
Modified: bigboard/trunk/bigboard/themes/default.py
===================================================================
--- bigboard/trunk/bigboard/themes/default.py 2007-12-14 23:52:16 UTC (rev 7067)
+++ bigboard/trunk/bigboard/themes/default.py 2007-12-14 23:55:36 UTC (rev 7068)
@@ -8,6 +8,9 @@
class DefaultTheme(Singleton):
def __init__(self):
super(DefaultTheme, self).__init__()
+
+ self.opacity = 0.85
+
self.background = 0xFFFFFFFF
self.prelight = 0xE2E2E2FF
self.foreground = 0x000000FF
Modified: bigboard/trunk/bigboard/themes/fedora.py
===================================================================
--- bigboard/trunk/bigboard/themes/fedora.py 2007-12-14 23:52:16 UTC (rev 7067)
+++ bigboard/trunk/bigboard/themes/fedora.py 2007-12-14 23:55:36 UTC (rev 7068)
@@ -7,6 +7,9 @@
class FedoraTheme(DefaultTheme):
def __init__(self):
super(FedoraTheme, self).__init__()
+
+ self.opacity = 0.9
+
self.background = 0x345B75FF
self.foreground = 0xFFFFFFFF
self.header_fg = self._rgba_to_cairo(self.foreground)
Modified: bigboard/trunk/main.py
===================================================================
--- bigboard/trunk/main.py 2007-12-14 23:52:16 UTC (rev 7067)
+++ bigboard/trunk/main.py 2007-12-14 23:55:36 UTC (rev 7068)
@@ -3,7 +3,9 @@
import os, sys, threading, getopt, logging, StringIO, stat, signal
import xml.dom.minidom, urllib2, urlparse, subprocess, weakref
-import gobject, gtk, pango
+# This line makes jhbuild find the jhbuilt pygtk
+import pygtk; pygtk.require ('2.0')
+import gobject, gtk, pango, cairo
import gnome.ui, gconf
# We need to import this early before gnome_program_init() is called
import gnomeapplet
@@ -19,7 +21,7 @@
import bigboard
import bigboard.big_widgets
from bigboard.big_widgets import Sidebar, CanvasHBox, CanvasVBox, ActionLink, ThemedText
-from bigboard.big_widgets import Button, GradientHeader, ThemedWidgetMixin, ThemeManager
+from bigboard.big_widgets import Button, GradientHeader, ThemedWidgetMixin, ThemeManager, Header
from bigboard.stock import Stock
import bigboard.libbig
try:
@@ -274,17 +276,7 @@
self.widget = ggadget.Gadget(metainfo, env)
self.widget.show_all()
self.set_property('widget', self.widget)
-
-class Header(hippo.CanvasBox, ThemedWidgetMixin):
- def __init__(self):
- super(Header, self).__init__(orientation=hippo.ORIENTATION_HORIZONTAL,
- background_color=0xFF0000FF)
- def do_paint_below_children(self, cr, dmgbox):
- area = self.get_background_area()
- self.get_theme().draw_header(cr, area)
-gobject.type_register(Header)
-
class HeaderButton(hippo.CanvasBox, ThemedWidgetMixin):
def __init__(self):
hippo.CanvasBox.__init__(self, box_width=40, xalign=hippo.ALIGNMENT_END,
@@ -416,9 +408,30 @@
self._exchanges = {} ## metainfo.srcurl to Exchange
- self._canvas = hippo.Canvas()
+ self._canvas = canvas = hippo.Canvas()
self._dw.get_content().add(self._canvas)
-
+ cwin = self._dw
+ self.__compositing = gtk.gdk.display_get_default().supports_composite()
+ _logger.debug("compositing: %s", self.__compositing)
+# screen = cwin.get_screen()
+# rgba = screen.get_rgba_colormap()
+# cwin.set_colormap(rgba)
+# cwin.set_app_paintable(True)
+# def fitty_opacity(w, e):
+# ctx = w.window.cairo_create()
+# ctx.set_source_pixmap(canvas.window, canvas.allocation.x, canvas.allocation.y)
+# region = gtk.gdk.region_rectangle(canvas.allocation)
+# region.intersect(gtk.gdk.region_rectangle(e.area))
+# print >>sys.stderr, "e: %s" % (region,)
+# ctx.region(region)
+# ctx.clip()
+#
+# ctx.set_operator(cairo.OPERATOR_OVER)
+# ctx.paint_with_alpha(0.5)
+# cwin.connect_after('expose-event', fitty_opacity)
+# cwin.realize()
+# cwin.window.set_composited(True)
+
self._main_box = hippo.CanvasBox(border_right=1, border_color=0x999999FF, padding_bottom=4)
self._canvas.set_root(self._main_box)
@@ -576,6 +589,9 @@
def __sync_theme(self, *args):
theme = self.__theme_mgr.get_theme()
+ if self.__compositing:
+ self._dw.realize()
+ self._dw.set_opacity(theme.opacity)
self._canvas.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("#%6X" % (theme.background >> 8,)))
self._canvas.queue_draw_area(0,0,-1,-1)
@@ -841,7 +857,7 @@
usage()
sys.exit()
- signal.signal(signal.SIGINT, lambda i,frame: sys.stderr.write('Caught SIGINT, departing this dear world\n') or os._exit(0))
+ signal.signal(signal.SIGINT, lambda i,frame: sys.stderr.write('Caught SIGINT\n') or os._exit(0))
if (not os.environ.has_key('OD_SESSION')):
warn = gconf.client_get_default().get_without_default(GCONF_PREFIX + 'warn_outside_online_desktop')
@@ -893,7 +909,6 @@
gtk.icon_theme_get_default().prepend_search_path(icon_datadir)
bus = dbus.SessionBus()
- bus_name = dbus.service.BusName(BUS_NAME_STR, bus=bus)
if replace:
try:
@@ -901,7 +916,8 @@
bb.Kill()
except dbus.DBusException, e:
pass
-
+
+ bus_name = dbus.service.BusName(BUS_NAME_STR, bus=bus)
_logger.debug("Requesting D-BUS name")
try:
bigboard.libbig.dbusutil.take_name(BUS_NAME_STR, replace, on_name_lost)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]