[pitivi/gtktimeline] timeline: grey out thumbnails on clip selection



commit 9206483a0e733076696c9146cd92b21f955f9c82
Author: Thibault Saunier <tsaunier gnome org>
Date:   Mon May 18 11:40:34 2015 +0200

    timeline: grey out thumbnails on clip selection
    
    Making them semi transparent making the black background visible.
    
    Fixes http://phabricator.freedesktop.org/T58

 pitivi/timeline/elements.py   |    3 +++
 pitivi/timeline/previewers.py |   12 ++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index 59ee354..1d38c0b 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -380,6 +380,9 @@ class TimelineElement(Gtk.Layout, timelineUtils.Zoomable, Loggable):
         if self.__keyframeCurve:
             self.__keyframeCurve.props.visible = selected
 
+        if self.__previewer:
+            self.__previewer.setSelected(selected)
+
     def __keyframePlotChangedCb(self, unused_curve):
         self.queue_draw()
 
diff --git a/pitivi/timeline/previewers.py b/pitivi/timeline/previewers.py
index 937fa8f..679c531 100644
--- a/pitivi/timeline/previewers.py
+++ b/pitivi/timeline/previewers.py
@@ -147,6 +147,9 @@ class PreviewGenerator(object):
         """
         PreviewGenerator.__manager.addPipeline(self)
 
+    def setSelected(self, selected):
+        pass
+
 
 class VideoPreviewer(Gtk.Layout, PreviewGenerator, Zoomable, Loggable):
 
@@ -485,6 +488,15 @@ class VideoPreviewer(Gtk.Layout, PreviewGenerator, Zoomable, Loggable):
             self.duration = new_duration
             self._force_redraw()
 
+    def setSelected(self, selected):
+        if selected:
+            opacity = 0.5
+        else:
+            opacity = 1.0
+
+        for thumb in self.get_children():
+            thumb.props.opacity = opacity
+
     def startGeneration(self):
         self._setupPipeline()
         self._startThumbnailingWhenIdle()


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