From c1894d3ec456e4e36efa62169e9445da9f1dc0e8 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 21 Sep 2007 22:13:33 +0000 Subject: Implement a do_size_request to be able to correct resize on size changes, and set a minimum width. Fixes #3497 and adresses #3081. --- (limited to 'sugar') diff --git a/sugar/graphics/palette.py b/sugar/graphics/palette.py index 3873d38..2fc2a2a 100644 --- a/sugar/graphics/palette.py +++ b/sugar/graphics/palette.py @@ -211,6 +211,15 @@ class Palette(gtk.Window): else: raise AssertionError + def do_size_request(self, requisition): + gtk.Window.do_size_request(self, requisition) + + requisition.width = max(requisition.width, self._full_request[0]) + + # Minimum width + requisition.width = max(requisition.width, + style.zoom(style.GRID_CELL_SIZE*2)) + def do_size_allocate(self, allocation): gtk.Window.do_size_allocate(self, allocation) @@ -273,13 +282,9 @@ class Palette(gtk.Window): def _update_full_request(self): state = self.palette_state - self.set_size_request(-1, -1) - self._set_state(self.SECONDARY) self._full_request = self.size_request() - self.set_size_request(self._full_request[0], -1) - self._set_state(state) def _update_position(self): -- cgit v0.9.1