[pitivi] titleeditor: Make sure to set default values and update widget afterward



commit 0938015a9f210ce629cc7d0aee8c355f0c59ba9d
Author: Thibault Saunier <tsaunier gnome org>
Date:   Wed Dec 17 21:21:07 2014 +0100

    titleeditor: Make sure to set default values and update widget afterward
    
    And make default background black, because of: https://bugzilla.gnome.org/show_bug.cgi?id=681447
    
    https://bugzilla.gnome.org/show_bug.cgi?id=741670

 pitivi/titleeditor.py |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index ac6117a..c3baa73 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -38,7 +38,7 @@ from pitivi.utils.ui import argb_to_gdk_rgba, gdk_rgba_to_argb
 
 
 FOREGROUND_DEFAULT_COLOR = 0xFFFFFFFF  # White
-BACKGROUND_DEFAULT_COLOR = 0x00000000  # Transparent
+BACKGROUND_DEFAULT_COLOR = 0xFF000000  # Black
 
 
 class TitleEditor(Loggable):
@@ -245,7 +245,6 @@ class TitleEditor(Loggable):
         The user clicked the "Create and insert" button, initialize the UI
         """
         clip = GES.TitleClip()
-        clip.set_text("")
         clip.set_duration(int(Gst.SECOND * 5))
 
         # TODO: insert on the current layer at the playhead position.
@@ -254,10 +253,15 @@ class TitleEditor(Loggable):
         self.app.gui.timeline_ui.timeline.selection.setToObj(clip, SELECT)
 
         self._setting_initial_props = True
-        clip.set_color(FOREGROUND_DEFAULT_COLOR)
-        clip.set_background(BACKGROUND_DEFAULT_COLOR)
+        source = self.source = clip.get_children(False)[0]
+        assert(source.set_child_property("text", ""))
+        assert(source.set_child_property("foreground-color", BACKGROUND_DEFAULT_COLOR))
+        assert(source.set_child_property("color", FOREGROUND_DEFAULT_COLOR))
+        assert(source.set_child_property("font-desc", "Sans 10"))
         self._setting_initial_props = False
 
+        self._updateFromSource()
+
     def _propertyChangedCb(self, source, unused_gstelement, pspec):
         if self._setting_initial_props:
             return


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