r7110 - in bigboard/trunk: . bigboard
- From: commits mugshot org
- To: online-desktop-list gnome org
- Subject: r7110 - in bigboard/trunk: . bigboard
- Date: Thu, 20 Dec 2007 21:16:27 -0600 (CST)
Author: walters
Date: 2007-12-20 21:16:26 -0600 (Thu, 20 Dec 2007)
New Revision: 7110
Modified:
bigboard/trunk/bigboard.schemas.in
bigboard/trunk/bigboard/big_widgets.py
bigboard/trunk/bigboard/libgimmie.py
bigboard/trunk/main.py
Log:
Add experimental eastern orientation.
Based on patch from John Palmieri:
http://groups.google.com/group/mugshot/browse_thread/thread/c8c8e1bf0611386b?hl=en
Modified: bigboard/trunk/bigboard/big_widgets.py
===================================================================
--- bigboard/trunk/bigboard/big_widgets.py 2007-12-20 21:58:09 UTC (rev 7109)
+++ bigboard/trunk/bigboard/big_widgets.py 2007-12-21 03:16:26 UTC (rev 7110)
@@ -503,12 +503,8 @@
'show' : 'override',
}
- def __init__(self, is_left, strut_key):
- gravity = gtk.gdk.GRAVITY_WEST
- if not is_left:
- gravity = gtk.gdk.GRAVITY_EAST
- DockWindow.__init__(self, gravity)
- self.is_left = is_left
+ def __init__(self, strut_key):
+ DockWindow.__init__(self, gtk.gdk.GRAVITY_WEST)
self.__watcher = None
self.__strut_key = strut_key
@@ -531,11 +527,13 @@
def __on_workarea_changed(self, watcher):
(x,y,width,height) = watcher.get_workarea()
self.set_size_request(-1, height)
- self.move(0, y)
+ if self.edge_gravity == gtk.gdk.GRAVITY_WEST:
+ self.move(0, y)
+ else:
+ self.move(width, y)
def do_set_wm_strut(self):
kwargs = {}
if not gconf.client_get_default().get_bool(self.__strut_key):
kwargs['remove'] = True
super(Sidebar, self).do_set_wm_strut(**kwargs)
-
Modified: bigboard/trunk/bigboard/libgimmie.py
===================================================================
--- bigboard/trunk/bigboard/libgimmie.py 2007-12-20 21:58:09 UTC (rev 7109)
+++ bigboard/trunk/bigboard/libgimmie.py 2007-12-21 03:16:26 UTC (rev 7110)
@@ -52,11 +52,14 @@
def get_edge_gravity(self):
return self.edge_gravity
+ def set_gravity(self, gravity):
+ self.edge_gravity = gravity
+
def do_realize(self):
ret = gtk.Window.do_realize(self)
self.do_set_wm_strut()
- return ret
-
+ return ret
+
# thanks to Gimmie (Alex Graveley) for this method
def do_set_wm_strut(self, remove=False):
'''
@@ -72,8 +75,8 @@
elif remove:
return
- if self.edge_gravity != gtk.gdk.GRAVITY_WEST:
- raise "haven't implemented gravities other than WEST"
+ if not self.edge_gravity in (gtk.gdk.GRAVITY_WEST, gtk.gdk.GRAVITY_EAST):
+ raise ValueError("haven't implemented north/south gravity")
if self.window:
# values are left, right, top, bottom
@@ -82,16 +85,21 @@
geom = self.get_screen().get_monitor_geometry(0)
(width, height) = self.size_request()
- _logger.debug("setting west strut to %d width" % (width,))
+ if self.edge_gravity == gtk.gdk.GRAVITY_WEST:
+ _logger.debug("setting WEST strut to %d width" % (width,))
+ propvals[0] = width
+ elif self.edge_gravity == gtk.gdk.GRAVITY_EAST:
+ _logger.debug("setting EAST strut to %d width" % (width,))
+ propvals[1] = width
- propvals[0] = width
-
# tell window manager to not overlap buttons with maximized window
self.window.property_change("_NET_WM_STRUT",
"CARDINAL",
32,
gtk.gdk.PROP_MODE_REPLACE,
propvals)
+
+
else:
_logger.debug("no window, ignoring strut")
Modified: bigboard/trunk/bigboard.schemas.in
===================================================================
--- bigboard/trunk/bigboard.schemas.in 2007-12-20 21:58:09 UTC (rev 7109)
+++ bigboard/trunk/bigboard.schemas.in 2007-12-21 03:16:26 UTC (rev 7110)
@@ -71,6 +71,17 @@
<locale name="C">
<short>Number of applications to show in sidebar</short>
</locale>
- </schema>
+ </schema>
+ <schema>
+ <key>/schemas/apps/bigboard/orientation</key>
+ <applyto>/apps/bigboard/orientation</applyto>
+ <owner>bigboard</owner>
+ <type>string</type>
+ <default>west</default>
+ <locale name="C">
+ <short>Bigboard panel orientation</short>
+ <long>The orientation of the Bigboard panel. Possible values are "west" or "east". The key specifies which screen edge the panel is on.</long>
+ </locale>
+ </schema>
</schemalist>
</gconfschemafile>
Modified: bigboard/trunk/main.py
===================================================================
--- bigboard/trunk/main.py 2007-12-20 21:58:09 UTC (rev 7109)
+++ bigboard/trunk/main.py 2007-12-21 03:16:26 UTC (rev 7110)
@@ -389,11 +389,13 @@
_logger.info("constructing")
- self._dw = Sidebar(True, GCONF_PREFIX + 'visible')
self.__popped_out = False
self.__shell = None
gconf_client = gconf.client_get_default()
+ self._dw = Sidebar(GCONF_PREFIX + 'visible')
+ gconf_client.notify_add(GCONF_PREFIX + 'orientation', self.__sync_orient)
+ self.__sync_orient()
self.__keybinding = gconf_client.get_string('/apps/bigboard/focus_key')
if self.__keybinding:
@@ -571,6 +573,18 @@
self.__leave_popped_out_state(immediate=True)
@log_except()
+ def __sync_orient(self, *args):
+ orient = gconf.client_get_default().get_string(GCONF_PREFIX + 'orientation')
+ if not orient:
+ orient = 'west'
+ if orient.lower() == 'west':
+ gravity = gtk.gdk.GRAVITY_WEST
+ else:
+ gravity = gtk.gdk.GRAVITY_EAST
+ self._dw.set_gravity(gravity)
+ self.__queue_strut()
+
+ @log_except()
def _toggle_size(self):
_logger.debug("toggling size")
expanded = gconf.client_get_default().get_bool(GCONF_PREFIX + 'expand')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]