[pitivi] titleeditor: Better defaults for the title clips



commit 1e78692ea5041cd263941acd41d21b2154d3e99a
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Thu Nov 5 17:08:42 2015 +0100

    titleeditor: Better defaults for the title clips
    
    Reviewed-by: Thibault Saunier <tsaunier gnome org>
    Differential Revision: https://phabricator.freedesktop.org/D555

 pitivi/titleeditor.py |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index 909a81a..3c574c0 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -40,6 +40,9 @@ from pitivi.utils.ui import argb_to_gdk_rgba, gdk_rgba_to_argb
 
 FOREGROUND_DEFAULT_COLOR = 0xFFFFFFFF  # White
 BACKGROUND_DEFAULT_COLOR = 0x00000000  # Transparent
+DEFAULT_FONT_DESCRIPTION = "Sans 36"
+DEFAULT_VALIGNMENT = GES.TextVAlign.CENTER
+DEFAULT_HALIGNMENT = GES.TextHAlign.CENTER
 
 
 class TitleEditor(Loggable):
@@ -110,8 +113,10 @@ class TitleEditor(Loggable):
     def _setChildProperty(self, name, value):
         self.action_log.begin("Title %s change" % name)
         self._setting_props = True
-        self.source.set_child_property(name, value)
-        self._setting_props = False
+        try:
+            assert(self.source.set_child_property(name, value))
+        finally:
+            self._setting_props = False
         self.action_log.commit()
 
     def _backgroundColorButtonCb(self, widget):
@@ -240,7 +245,9 @@ class TitleEditor(Loggable):
         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"))
+        assert(source.set_child_property("font-desc", DEFAULT_FONT_DESCRIPTION))
+        assert(source.set_child_property("valignment", DEFAULT_VALIGNMENT))
+        assert(source.set_child_property("halignment", DEFAULT_HALIGNMENT))
         # Select it so the Title editor becomes active.
         self._selection.setSelection([clip], SELECT)
 


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