[pitivi] timeline: Simplify the handlebar mouseleave handler



commit bec11cc85fcc33e38da8494a09f31577f86ec1c4
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Mon Jan 6 00:11:13 2014 +0100

    timeline: Simplify the handlebar mouseleave handler

 pitivi/timeline/elements.py |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index e47514d..e7c0d09 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -259,17 +259,13 @@ class TrimHandle(Clutter.Texture):
 
     def _leaveEventCb(self, actor, event):
         self.timelineElement.set_reactive(True)
+        children = self.timelineElement.get_children()
 
-        actor = self.timelineElement.timeline._container.stage.get_actor_at_pos(Clutter.PickMode.ALL, 
event.x, event.y)
-        try:
-            element = actor.bElement
-            if element != self.timelineElement.bELement and not self.isSelected:
-                self.timelineElement.hideHandles()
-        except AttributeError:
-            if not self.isSelected:
-                self.timelineElement.hideHandles()
+        other_actor = self.timelineElement.timeline._container.stage.get_actor_at_pos(Clutter.PickMode.ALL, 
event.x, event.y)
+        if other_actor not in children and not self.isSelected:
+            self.timelineElement.hideHandles()
 
-        for elem in self.timelineElement.get_children():
+        for elem in children:
             elem.set_reactive(True)
         self.set_from_file(os.path.join(configure.get_pixmap_dir(), "trimbar-normal.png"))
         
self.timelineElement.timeline._container.embed.get_window().set_cursor(Gdk.Cursor.new(Gdk.CursorType.ARROW))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]