Ticket #2184: remove_resizable_false-shrink.patch

File remove_resizable_false-shrink.patch, 1.6 KB (added by manuq, 11 years ago)

Sort out palette shrink, the issue appears again

  • src/sugar3/graphics/palette.py

    diff --git a/src/sugar3/graphics/palette.py b/src/sugar3/graphics/palette.py
    index a085fa9..70d8fd9 100644
    a b class Palette(PaletteWindow): 
    383383
    384384        if self._palette_state == self.PRIMARY:
    385385            self._secondary_box.hide()
     386            self._widget.shrink_to_content()
    386387
    387388    def _set_palette_state(self, state):
    388389        if self._palette_state == state:
    class Palette(PaletteWindow): 
    390391
    391392        if state == self.PRIMARY:
    392393            self._secondary_box.hide()
     394            self._widget.shrink_to_content()
    393395        elif state == self.SECONDARY:
    394396            self._secondary_box.show()
    395397            self.update_position()
  • src/sugar3/graphics/palettewindow.py

    diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py
    index c48ae55..7c69271 100644
    a b class _PaletteWindowWidget(Gtk.Window): 
    276276
    277277        self._palette = palette
    278278        self.set_decorated(False)
    279         self.set_resizable(False)
     279        self.set_has_resize_grip(False)
    280280        self.set_position(Gtk.WindowPosition.NONE)
    281281
    282282        context = self.get_style_context()
    class _PaletteWindowWidget(Gtk.Window): 
    333333        # the configure request handler and finally size_allocate is called.
    334334        self._old_alloc = allocation
    335335
     336    def shrink_to_content(self):
     337        minimun, natural = self.get_preferred_size()
     338        self.resize(minimun.width, minimun.height)
     339
    336340    def set_invoker(self, invoker):
    337341        self._invoker = invoker
    338342