[pitivi] Define some more harmonized default colors for timeline elements/clips



commit 71a9d45207cfc03b130de276ed744448c16db676
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date:   Thu Apr 25 16:52:08 2013 -0400

    Define some more harmonized default colors for timeline elements/clips
    
    Also add comments for possible colors to be used as gradients eventually,
    and make transitions not use rounded corners on the timeline.

 pitivi/timeline/elements.py |   27 ++++++++++++++-------------
 pitivi/timeline/timeline.py |   11 ++---------
 2 files changed, 16 insertions(+), 22 deletions(-)
---
diff --git a/pitivi/timeline/elements.py b/pitivi/timeline/elements.py
index a927a6e..dcb2f8d 100644
--- a/pitivi/timeline/elements.py
+++ b/pitivi/timeline/elements.py
@@ -146,13 +146,10 @@ class Ghostclip(Clutter.Actor):
     """
     def __init__(self, track_type, bElement=None):
         Clutter.Actor.__init__(self)
-
         self.track_type = track_type
         self.bElement = bElement
-
-        self.set_background_color(Clutter.Color.new(100, 100, 100, 50))
+        self.set_background_color(Clutter.Color.new(255, 255, 255, 50))
         self.props.visible = False
-
         self.shouldCreateLayer = False
 
     def setNbrLayers(self, nbrLayers):
@@ -443,17 +440,13 @@ class TimelineElement(Clutter.Actor, Zoomable):
         # TODO: difference between Actor.new() and Actor()?
         self.marquee = Clutter.Actor()
         self.marquee.bElement = self.bElement
-
         self.marquee.set_background_color(Clutter.Color.new(60, 60, 60, 100))
         self.marquee.props.visible = False
-
         self.add_child(self.marquee)
 
     def _connectToEvents(self):
         self.dragAction = Clutter.DragAction()
-
         self.add_action(self.dragAction)
-
         self.dragAction.connect("drag-progress", self._dragProgressCb)
         self.dragAction.connect("drag-begin", self._dragBeginCb)
         self.dragAction.connect("drag-end", self._dragEndCb)
@@ -494,6 +487,11 @@ class TimelineElement(Clutter.Actor, Zoomable):
 
 class Gradient(Clutter.Actor):
     def __init__(self, rb, gb, bb, re, ge, be):
+        """
+        Creates a rectangle with a gradient. The first three parameters
+        are the gradient's RGB values at the top, the last three params
+        are the RGB values at the bottom.
+        """
         Clutter.Actor.__init__(self)
         self.canvas = Clutter.Canvas()
         self.linear = cairo.LinearGradient(0, 0, 10, EXPANDED_SIZE)
@@ -540,9 +538,13 @@ class URISourceElement(TimelineElement):
 
     def _createBackground(self, track):
         if track.type == GES.TrackType.AUDIO:
-            self.background = Gradient(0x1F, 0x1E, 0x21, 0x46, 0x61, 0x76)
+            # Audio clips go from dark green to light green
+            # (27, 46, 14, 255) to (73, 108, 33, 255)
+            self.background = Gradient(27, 46, 14, 73, 108, 33)
         else:
-            self.background = Gradient(0xE1, 0xE8, 0xEE, 0xAA, 0xA3, 0x7F)
+            # Video clips go from almost black to gray
+            # (15, 15, 15, 255) to (45, 45, 45, 255)
+            self.background = Gradient(15, 15, 15, 45, 45, 45)
 
         self.background.bElement = self.bElement
 
@@ -636,10 +638,9 @@ class TransitionElement(TimelineElement):
         self.isDragged = True
 
     def _createBackground(self, track):
-        self.background = RoundedRectangle(0, 0, 5, 5)
+        self.background = RoundedRectangle(0, 0, 0, 0)
         color = Cogl.Color()
-
-        color.init_from_4ub(100, 100, 100, 125)
+        color.init_from_4ub(35, 85, 125, 125)  # light blue
         self.background.set_color(color)
         self.background.set_border_width(1)
         self.background.set_position(0, 0)
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index 13734b2..ea03b01 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -146,7 +146,6 @@ class TimelineStage(Clutter.ScrollActor, Zoomable):
     def __init__(self, container):
         Clutter.ScrollActor.__init__(self)
         Zoomable.__init__(self)
-
         self.bTimeline = None
         self._container = container
         self.elements = []
@@ -154,9 +153,6 @@ class TimelineStage(Clutter.ScrollActor, Zoomable):
         self.selection = Selection()
         self._scroll_point = Clutter.Point()
         self.lastPosition = 0  # Saved for redrawing when paused
-
-        self.set_background_color(Clutter.Color.new(31, 30, 33, 255))
-
         self._createPlayhead()
         self._createSnapIndicator()
 
@@ -338,23 +334,19 @@ class TimelineStage(Clutter.ScrollActor, Zoomable):
 
     def _createPlayhead(self):
         self.playhead = Clutter.Actor()
-
         self.playhead.set_background_color(Clutter.Color.new(200, 0, 0, 255))
         self.playhead.set_size(0, 0)
         self.playhead.set_position(0, 0)
         self.playhead.set_easing_duration(0)
         self.playhead.set_z_position(1)
-
         self.add_child(self.playhead)
 
     def _createSnapIndicator(self):
         self._snap_indicator = Clutter.Actor()
-
-        self._snap_indicator.set_background_color(Clutter.Color.new(0, 0, 250, 200))
+        self._snap_indicator.set_background_color(Clutter.Color.new(50, 150, 200, 200))
         self._snap_indicator.props.visible = False
         self._snap_indicator.props.width = 3
         self._snap_indicator.props.y = 0
-
         self.add_child(self._snap_indicator)
 
     def _addTimelineElement(self, track, bElement):
@@ -682,6 +674,7 @@ class Timeline(Gtk.VBox, Zoomable):
         self.shiftMask = False
         self.controlMask = False
 
+        # TODO: make the bg a gradient from (0, 0, 0, 255) to (50, 50, 50, 255)
         self.stage.set_background_color(Clutter.Color.new(31, 30, 33, 255))
         self.timeline.set_position(CONTROL_WIDTH, 0)
         self.controls.set_position(0, 0)


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