Show/Hide the color palette correctly (#374)

This commit is contained in:
Benjamin Berg 2009-02-24 14:29:01 +01:00
parent a4e9c9c78e
commit 607c2a9610

View File

@ -102,7 +102,12 @@ class _ColorButton(gtk.Button):
def do_clicked(self):
if self._palette:
self._palette.popup(immediate=True)
if not self._palette.is_up():
self._palette.popup(immediate=True,
state=self._palette.SECONDARY)
else:
self._palette.popdown(immediate=True)
return True
def set_color(self, color):
assert isinstance(color, gtk.gdk.Color)