Ticket #1268: sugar-1268.patch

File sugar-1268.patch, 2.1 KB (added by alsroot, 15 years ago)
  • src/sugar/graphics/palette.py

    From b2265d692e1f39b7cac553e4dd8c3dbb16b6a76f Mon Sep 17 00:00:00 2001
    From: Aleksey Lim <alsroot@member.fsf.org>
    Date: Fri, 4 Sep 2009 10:05:16 +0000
    Subject: Wrong calculated positions for palettes #1268
    
    ---
     src/sugar/graphics/palette.py       |    4 ++++
     src/sugar/graphics/palettewindow.py |   13 +++++++------
     2 files changed, 11 insertions(+), 6 deletions(-)
    
    diff --git a/src/sugar/graphics/palette.py b/src/sugar/graphics/palette.py
    index f58e7ac..2ea2376 100644
    a b class Palette(PaletteWindow): 
    195195
    196196        self._secondary_anim.start()
    197197
     198    def on_popdown(self):
     199        # to suppress glitches while later re-opening
     200        self.set_palette_state(self.PRIMARY)
     201
    198202    def on_enter(self, event):
    199203        PaletteWindow.on_enter(self, event)
    200204        self._secondary_anim.start()
  • src/sugar/graphics/palettewindow.py

    diff --git a/src/sugar/graphics/palettewindow.py b/src/sugar/graphics/palettewindow.py
    index 454ac8d..aa5b416 100644
    a b class PaletteWindow(gtk.Window): 
    333333        if not immediate:
    334334            self._popdown_anim.start()
    335335        else:
    336             self._popdown_anim.stop()
     336            self.on_popdown()
     337            self.size_request()
    337338            self.hide()
    338339
     340    def on_popdown(self):
     341        self._popdown_anim.stop()
     342
    339343    def on_invoker_enter(self):
    340344        self._mouse_detector.start()
    341345
    class _PopupAnimation(animator.Animation): 
    414418
    415419    def next_frame(self, current):
    416420        if current == 1.0:
    417             self._palette.show()
    418             # we have to invoke update_position() twice
    419             # since WM could ignore first move() request
    420             self._palette.update_position()
     421            self._palette.popup(immediate=True)
    421422
    422423
    423424class _PopdownAnimation(animator.Animation):
    class _PopdownAnimation(animator.Animation): 
    428429
    429430    def next_frame(self, current):
    430431        if current == 1.0:
    431             self._palette.hide()
     432            self._palette.popdown(immediate=True)
    432433
    433434
    434435class Invoker(gobject.GObject):