Wrong calculated positions for palettes #1268

This commit is contained in:
Aleksey Lim 2009-09-04 10:05:16 +00:00
parent 2b78463830
commit e97dd135eb
2 changed files with 11 additions and 6 deletions

View File

@ -195,6 +195,10 @@ class Palette(PaletteWindow):
self._secondary_anim.start()
def on_popdown(self):
# to suppress glitches while later re-opening
self.set_palette_state(self.PRIMARY)
def on_enter(self, event):
PaletteWindow.on_enter(self, event)
self._secondary_anim.start()

View File

@ -333,9 +333,13 @@ class PaletteWindow(gtk.Window):
if not immediate:
self._popdown_anim.start()
else:
self._popdown_anim.stop()
self.on_popdown()
self.size_request()
self.hide()
def on_popdown(self):
self._popdown_anim.stop()
def on_invoker_enter(self):
self._mouse_detector.start()
@ -414,10 +418,7 @@ class _PopupAnimation(animator.Animation):
def next_frame(self, current):
if current == 1.0:
self._palette.show()
# we have to invoke update_position() twice
# since WM could ignore first move() request
self._palette.update_position()
self._palette.popup(immediate=True)
class _PopdownAnimation(animator.Animation):
@ -428,7 +429,7 @@ class _PopdownAnimation(animator.Animation):
def next_frame(self, current):
if current == 1.0:
self._palette.hide()
self._palette.popdown(immediate=True)
class Invoker(gobject.GObject):