Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Kaufmann <humitos@gmail.com>2012-11-29 15:32:04 (GMT)
committer Manuel QuiƱones <manuq@laptop.org>2012-11-29 17:50:04 (GMT)
commit1497ebc0063e7e4c5b4169c6746fd84b25573caa (patch)
tree7b3ad9fda55f6544a877aa2a5289154385839a0c
parent783db600273b4ccf4726423048fd8f8db7ec8ec3 (diff)
CanvasIcon: do not keep it ACTIVE when right-click twice SL #4224
When a CanvasIcon is right-clicked __button_press_event_cb and __palette_popup_cb are called but not __button_release_event_cb. So, ACTIVE flag is set but immediately removed by __palette_popup_cb and PRELIGHT is set. Now, if the user right-click it again while the palette is popped up, __button_press_event_cb is called and it sets ACTIVE flag but __palette_popup_cb is not called again because the palette is already shown and that makes the icon to keep in ACTIVE state. This patch checks if the palette is popped up when __button_press_event_cb is called and if the palette is not popped up the ACTIVE flag is set. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Acked-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r--src/sugar3/graphics/icon.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sugar3/graphics/icon.py b/src/sugar3/graphics/icon.py
index 507db41..5bdb3b8 100644
--- a/src/sugar3/graphics/icon.py
+++ b/src/sugar3/graphics/icon.py
@@ -727,8 +727,9 @@ class CanvasIcon(EventIcon):
self.unset_state_flags(Gtk.StateFlags.PRELIGHT)
def __button_press_event_cb(self, icon, event):
- self.set_state_flags(self.get_state_flags() | Gtk.StateFlags.ACTIVE,
- clear=True)
+ if not self.palette.is_up():
+ self.set_state_flags(self.get_state_flags() | Gtk.StateFlags.ACTIVE,
+ clear=True)
def __button_release_event_cb(self, icon, event):
self.unset_state_flags(Gtk.StateFlags.ACTIVE)