[pitivi/1.0] viewer: Make overlay selection non-sticky



commit 1920fa224866da1cc87abd29daad0dbe419bca74
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Tue Apr 24 03:53:53 2018 +0200

    viewer: Make overlay selection non-sticky
    
    This allows an overlay to be deselected by clearing the timeline clips
    selection. Before once an overlay is selected, it was possible to
    deselect it only by selecting a different clip/overlay.
    
    Fixes #1839

 pitivi/viewer/overlay.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/pitivi/viewer/overlay.py b/pitivi/viewer/overlay.py
index 81e3fc22..43086d26 100644
--- a/pitivi/viewer/overlay.py
+++ b/pitivi/viewer/overlay.py
@@ -40,6 +40,8 @@ class Overlay(Gtk.DrawingArea, Loggable):
         self.project_size = numpy.array([project.videowidth,
                                          project.videoheight])
 
+        self._source.selected.connect("selected-changed", self.__source_selected_changed_cb)
+
     def _canvas_size_changed_cb(self, project):
         project = self.stack.app.project_manager.current_project
         self.project_size = numpy.array([project.videowidth,
@@ -63,6 +65,10 @@ class Overlay(Gtk.DrawingArea, Loggable):
             return
         self.stack.app.gui.context_tabs.set_current_page(page)
 
+    def __source_selected_changed_cb(self, unused_source, selected):
+        if not selected and self._is_selected():
+            self._deselect()
+
     def _deselect(self):
         self.stack.selected_overlay = None
         self.queue_draw()


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