diff options
author | Peter Palfrader <peter@palfrader.org> | 2013-01-16 12:05:08 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2013-01-16 12:05:08 +0000 |
commit | 46b5899564056ba29b723a8772bc8804369c76e5 (patch) | |
tree | 2387edd56ea2c815ea807b36e146fca99e350e5f /wss | |
parent | 9ae0f0b16248542017b90b75efc3945abdb11acc (diff) |
mess with wss a bit
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@572 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
Diffstat (limited to 'wss')
-rwxr-xr-x | wss | 44 |
1 files changed, 26 insertions, 18 deletions
@@ -31,6 +31,7 @@ import pygtk, gtk, glib import wnck +import datetime SCALE=50 BORDER=3 @@ -38,10 +39,13 @@ DELAY=500 class WSS: def cb_hide(self, data=None): + print datetime.datetime.now(), "cb hide" + print self.window.hide() return False def cb_update(self, widget, data=None): + print datetime.datetime.now(), "cb update" workspace = self.screen.get_active_workspace() if self.previous is not None: self.label.set_markup("<span size='xx-large'>%s</span>"%(workspace.get_name())) @@ -52,32 +56,37 @@ class WSS: self.paint() self.window.queue_draw() + print datetime.datetime.now(), 'show' self.window.show() self.previous = workspace def get_layout(self): wsposmap = {} - if self.layout is None: - wss = self.screen.get_workspaces() - maxrow = 0 - maxcol = 0 - for ws in wss: - r = ws.get_layout_row() - c = ws.get_layout_column() - if r > maxrow: maxrow = r - if c > maxcol: maxcol = c - wsposmap[ws.get_number()] = (r,c) - w = self.screen.get_width() - h = self.screen.get_height() - - self.layout = (w, h, maxrow+1, maxcol+1) - self.wsposmap = wsposmap - return self.layout + + wss = self.screen.get_workspaces() + maxrow = 0 + maxcol = 0 + for ws in wss: + r = ws.get_layout_row() + c = ws.get_layout_column() + if r > maxrow: maxrow = r + if c > maxcol: maxcol = c + wsposmap[ws.get_number()] = (r,c) + w = self.screen.get_width() + h = self.screen.get_height() + + layout = (w, h, maxrow+1, maxcol+1) + self.wsposmap = wsposmap + return layout def setup_table(self): - if self.table is not None: return width, height, rows, cols = self.get_layout() + if self.table is not None: + for area in self.areainfo: + area.set_size_request(width/SCALE+2, height/SCALE+2) + return + table = gtk.Table(rows, cols, True) table.set_col_spacings(BORDER) table.set_row_spacings(BORDER) @@ -191,7 +200,6 @@ class WSS: self.previous = None self.table = None self.cells = None - self.layout = None self.areainfo = None self.timerid = None |