Palettes: move PRIMARY and SECONDARY constant to the base class
Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Manuel Quiñones <manuq@laptop.org>
This commit is contained in:
parent
063e40d77d
commit
1224ab1451
@ -90,9 +90,6 @@ class Palette(PaletteWindow):
|
|||||||
display such information.
|
display such information.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PRIMARY = 0
|
|
||||||
SECONDARY = 1
|
|
||||||
|
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'activate': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
'activate': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
||||||
}
|
}
|
||||||
|
@ -439,6 +439,9 @@ class PaletteWindow(GObject.GObject):
|
|||||||
Provides basic management of child widget, invoker, and animation.
|
Provides basic management of child widget, invoker, and animation.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
PRIMARY = 0
|
||||||
|
SECONDARY = 1
|
||||||
|
|
||||||
__gsignals__ = {
|
__gsignals__ = {
|
||||||
'popup': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
'popup': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
||||||
'popdown': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
'popdown': (GObject.SignalFlags.RUN_FIRST, None, ([])),
|
||||||
@ -628,13 +631,13 @@ class PaletteWindow(GObject.GObject):
|
|||||||
self.on_invoker_leave()
|
self.on_invoker_leave()
|
||||||
|
|
||||||
def _invoker_right_click_cb(self, invoker):
|
def _invoker_right_click_cb(self, invoker):
|
||||||
self.popup(immediate=True, state=1)
|
self.popup(immediate=True, state=self.SECONDARY)
|
||||||
|
|
||||||
def _invoker_toggle_state_cb(self, invoker):
|
def _invoker_toggle_state_cb(self, invoker):
|
||||||
if self.is_up():
|
if self.is_up():
|
||||||
self.popdown(immediate=True)
|
self.popdown(immediate=True)
|
||||||
else:
|
else:
|
||||||
self.popup(immediate=True, state=1)
|
self.popup(immediate=True, state=self.SECONDARY)
|
||||||
|
|
||||||
def __enter_notify_cb(self, widget):
|
def __enter_notify_cb(self, widget):
|
||||||
self.on_enter()
|
self.on_enter()
|
||||||
|
Loading…
Reference in New Issue
Block a user