Fix several sizing bugs.

This commit is contained in:
Marco Pesenti Gritti 2007-08-17 16:18:57 +02:00
parent dfe8ff6806
commit de9e02b498
3 changed files with 9 additions and 11 deletions

View File

@ -268,16 +268,16 @@ class Frame(object):
screen_w = gtk.gdk.screen_width()
self._move_panel(self._top_panel, self._current_position,
0, - style.GRID_CELL_SIZE, 0, 0)
0, - self._top_panel.size, 0, 0)
self._move_panel(self._bottom_panel, self._current_position,
0, screen_h, 0, screen_h - style.GRID_CELL_SIZE)
0, screen_h, 0, screen_h - self._bottom_panel.size)
self._move_panel(self._left_panel, self._current_position,
- style.GRID_CELL_SIZE, 0, 0, 0)
- self._left_panel.size, 0, 0, 0)
self._move_panel(self._right_panel, self._current_position,
screen_w, 0, screen_w - style.GRID_CELL_SIZE, 0)
screen_w, 0, screen_w - self._right_panel.size, 0)
def _hide_completed_cb(self, animator):
self.mode = MODE_NONE

View File

@ -29,7 +29,7 @@ class FrameCanvasInvoker(CanvasInvoker):
return Palette.AROUND
def get_screen_area(self):
frame_thickness = style.GRID_CELL_SIZE - style.LINE_WIDTH
frame_thickness = style.GRID_CELL_SIZE
x = y = frame_thickness
width = gtk.gdk.screen_width() - frame_thickness

View File

@ -25,6 +25,7 @@ class FrameWindow(gtk.Window):
def __init__(self, position):
gtk.Window.__init__(self)
self.hover = False
self.size = style.GRID_CELL_SIZE + style.LINE_WIDTH
self._position = position
@ -80,15 +81,12 @@ class FrameWindow(gtk.Window):
def append(self, child, flags=0):
self._bg.append(child, flags)
def _update_size(self):
if self._position == gtk.POS_TOP or self._position == gtk.POS_BOTTOM:
width = gtk.gdk.screen_width()
height = style.GRID_CELL_SIZE
self.resize(gtk.gdk.screen_width(), self.size)
else:
width = style.GRID_CELL_SIZE
height = gtk.gdk.screen_height()
self.resize(width, height)
self.resize(self.size, gtk.gdk.screen_height())
def _realize_cb(self, widget):
self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG)