Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@sugarlabs.org>2009-05-05 14:49:27 (GMT)
committer Tomeu Vizoso <tomeu@sugarlabs.org>2009-05-05 14:49:27 (GMT)
commitf3c7d322cf492760303a2f6643fbe6359d4ef152 (patch)
tree35640776953548d194fb0566e304322b3a8faea0
parentf6a8be9eb2a075d9733cc96e52897e856bbca898 (diff)
Use the new style Gdk.Screen (part 2)
-rw-r--r--src/jarabe/frame/frame.py17
-rw-r--r--src/jarabe/journal/modalalert.py5
2 files changed, 11 insertions, 11 deletions
diff --git a/src/jarabe/frame/frame.py b/src/jarabe/frame/frame.py
index b17ded5..bfe8dd7 100644
--- a/src/jarabe/frame/frame.py
+++ b/src/jarabe/frame/frame.py
@@ -242,20 +242,19 @@ class Frame(object):
panel.connect('leave-notify-event', self._leave_notify_cb)
def _update_position(self):
- screen_h = gtk.gdk.screen_height()
- screen_w = gtk.gdk.screen_width()
+ screen = Gdk.Screen.get_default()
self._move_panel(self._top_panel, self.current_position,
0, - self._top_panel.size, 0, 0)
self._move_panel(self._bottom_panel, self.current_position,
- 0, screen_h, 0, screen_h - self._bottom_panel.size)
+ 0, screen.height, 0, screen.height - self._bottom_panel.size)
self._move_panel(self._left_panel, self.current_position,
- self._left_panel.size, 0, 0, 0)
self._move_panel(self._right_panel, self.current_position,
- screen_w, 0, screen_w - self._right_panel.size, 0)
+ screen.width, 0, screen.width - self._right_panel.size, 0)
def _size_changed_cb(self, screen):
self._update_position()
@@ -295,16 +294,16 @@ class Frame(object):
window = NotificationWindow()
- screen = gtk.gdk.screen_get_default()
+ screen = Gdk.Screen.get_default()
if corner == gtk.CORNER_TOP_LEFT:
window.move(0, 0)
elif corner == gtk.CORNER_TOP_RIGHT:
- window.move(screen.get_width() - style.GRID_CELL_SIZE, 0)
+ window.move(screen.width - style.GRID_CELL_SIZE, 0)
elif corner == gtk.CORNER_BOTTOM_LEFT:
- window.move(0, screen.get_height() - style.GRID_CELL_SIZE)
+ window.move(0, screen.height - style.GRID_CELL_SIZE)
elif corner == gtk.CORNER_BOTTOM_RIGHT:
- window.move(screen.get_width() - style.GRID_CELL_SIZE,
- screen.get_height() - style.GRID_CELL_SIZE)
+ window.move(screen.width - style.GRID_CELL_SIZE,
+ screen.height - style.GRID_CELL_SIZE)
else:
raise ValueError('Inalid corner: %r' % corner)
diff --git a/src/jarabe/journal/modalalert.py b/src/jarabe/journal/modalalert.py
index fe090a6..ac3d0cf 100644
--- a/src/jarabe/journal/modalalert.py
+++ b/src/jarabe/journal/modalalert.py
@@ -32,8 +32,9 @@ class ModalAlert(gtk.Window):
self.set_border_width(style.LINE_WIDTH)
offset = style.GRID_CELL_SIZE
- width = gtk.gdk.screen_width() - offset * 2
- height = gtk.gdk.screen_height() - offset * 2
+ screen = Gdk.Screen.get_default()
+ width = screen.width - offset * 2
+ height = screen.height - offset * 2
self.set_size_request(width, height)
self.set_position(gtk.WIN_POS_CENTER_ALWAYS)
self.set_decorated(False)