[pitivi] Use Gtk STYLE_CLASS constants for add_class



commit 124d98977a5b198c709083999d377145d0b83053
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Sun Jan 12 02:57:27 2014 +0100

    Use Gtk STYLE_CLASS constants for add_class

 pitivi/clipproperties.py    |    2 +-
 pitivi/effects.py           |    2 +-
 pitivi/mainwindow.py        |    2 +-
 pitivi/medialibrary.py      |    2 +-
 pitivi/project.py           |    4 ++--
 pitivi/render.py            |    2 +-
 pitivi/timeline/timeline.py |    8 ++++----
 pitivi/titleeditor.py       |    2 +-
 8 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index 70e67be..6b21111 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -163,7 +163,7 @@ class EffectProperties(Gtk.Expander, Loggable):
 
         # The toolbar that will go between the list of effects and properties
         self._toolbar = Gtk.Toolbar()
-        self._toolbar.get_style_context().add_class("inline-toolbar")
+        self._toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
         self._toolbar.set_icon_size(Gtk.IconSize.SMALL_TOOLBAR)
         removeEffectButton = Gtk.ToolButton()
         removeEffectButton.set_icon_name("list-remove-symbolic")
diff --git a/pitivi/effects.py b/pitivi/effects.py
index f7f08d6..0194a69 100644
--- a/pitivi/effects.py
+++ b/pitivi/effects.py
@@ -384,7 +384,7 @@ class EffectListWidget(Gtk.VBox, Loggable):
         builder.add_from_file(os.path.join(get_ui_dir(), "effectslibrary.ui"))
         builder.connect_signals(self)
         toolbar = builder.get_object("effectslibrary_toolbar")
-        toolbar.get_style_context().add_class("inline-toolbar")
+        toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
         self.video_togglebutton = builder.get_object("video_togglebutton")
         self.audio_togglebutton = builder.get_object("audio_togglebutton")
         self.categoriesWidget = builder.get_object("categories")
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index b6e9798..ee90f63 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -367,7 +367,7 @@ class PitiviMainWindow(Gtk.Window, Loggable):
         self.menu = self.uimanager.get_widget("/MainMenuBar")
         self._main_toolbar_box = Gtk.VBox()  # To reparent after fullscreen
         self.toolbar = self.uimanager.get_widget("/MainToolBar")
-        self.toolbar.get_style_context().add_class("primary-toolbar")
+        self.toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_PRIMARY_TOOLBAR)
         self._main_toolbar_box.add(self.toolbar)
         vbox.pack_start(self.menu, False, True, 0)
         vbox.pack_start(self._main_toolbar_box, False, True, 0)
diff --git a/pitivi/medialibrary.py b/pitivi/medialibrary.py
index 6ceea02..449d48b 100644
--- a/pitivi/medialibrary.py
+++ b/pitivi/medialibrary.py
@@ -153,7 +153,7 @@ class MediaLibraryWidget(Gtk.VBox, Loggable):
         self._warning_label = builder.get_object("warning_label")
         self._view_error_button = builder.get_object("view_error_button")
         toolbar = builder.get_object("medialibrary_toolbar")
-        toolbar.get_style_context().add_class("inline-toolbar")
+        toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
         self._remove_button = builder.get_object("media_remove_button")
         self._clipprops_button = builder.get_object("media_props_button")
         self._insert_button = builder.get_object("media_insert_button")
diff --git a/pitivi/project.py b/pitivi/project.py
index f5cca16..19079bd 100644
--- a/pitivi/project.py
+++ b/pitivi/project.py
@@ -1119,8 +1119,8 @@ class ProjectSettingsDialog():
         # Set the shading style in the contextual toolbars below presets
         video_presets_toolbar = getObj("video_presets_toolbar")
         audio_presets_toolbar = getObj("audio_presets_toolbar")
-        video_presets_toolbar.get_style_context().add_class("inline-toolbar")
-        audio_presets_toolbar.get_style_context().add_class("inline-toolbar")
+        video_presets_toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
+        audio_presets_toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
 
     def _setupUiConstraints(self):
         """
diff --git a/pitivi/render.py b/pitivi/render.py
index 415dd34..550a64c 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -661,7 +661,7 @@ class RenderDialog(Loggable):
 
         # Set the shading style in the toolbar below presets
         presets_toolbar = builder.get_object("render_presets_toolbar")
-        presets_toolbar.get_style_context().add_class("inline-toolbar")
+        presets_toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
 
     def _settingsChanged(self, project, key, value):
         self.updateResolution()
diff --git a/pitivi/timeline/timeline.py b/pitivi/timeline/timeline.py
index e85d329..f6beb24 100644
--- a/pitivi/timeline/timeline.py
+++ b/pitivi/timeline/timeline.py
@@ -862,14 +862,14 @@ class TimelineContainer(Gtk.Grid, Zoomable, Loggable):
         self.ruler.hide()
 
         toolbar = self.ui_manager.get_widget("/TimelineToolBar")
-        toolbar.get_style_context().add_class("inline-toolbar")
+        toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
         toolbar.set_orientation(Gtk.Orientation.VERTICAL)
         toolbar.set_style(Gtk.ToolbarStyle.ICONS)
         toolbar.get_accessible().set_name("timeline toolbar")
 
-        alter_style_class(".inline-toolbar", toolbar, "padding-left: %dpx; border-width: 0px; background: 
alpha (@base_color, 0.0);" % (SPACING / 2))
-        alter_style_class(".scrollbar.trough", self._vscrollbar, "border: alpha (@base_color, 0.0); 
background: alpha (@base_color, 0.0);")
-        alter_style_class(".scrollbar.trough", self._hscrollbar, "border: alpha (@base_color, 0.0); 
background: alpha (@base_color, 0.0);")
+        alter_style_class(".%s" % Gtk.STYLE_CLASS_INLINE_TOOLBAR, toolbar, "padding-left: %dpx; 
border-width: 0px; background: alpha (@base_color, 0.0);" % (SPACING / 2))
+        alter_style_class(".%s.trough" % Gtk.STYLE_CLASS_SCROLLBAR, self._vscrollbar, "border: alpha 
(@base_color, 0.0); background: alpha (@base_color, 0.0);")
+        alter_style_class(".%s.trough" % Gtk.STYLE_CLASS_SCROLLBAR, self._hscrollbar, "border: alpha 
(@base_color, 0.0); background: alpha (@base_color, 0.0);")
 
         # Toggle/pushbuttons like the "gapless mode" ones are special, it seems
         # you can't insert them as normal "actions", so we create them here:
diff --git a/pitivi/titleeditor.py b/pitivi/titleeditor.py
index f2d0e2b..c540ad1 100644
--- a/pitivi/titleeditor.py
+++ b/pitivi/titleeditor.py
@@ -606,7 +606,7 @@ class TitleEditor(Loggable):
         self.textarea = builder.get_object("textview")
         self.markup_button = builder.get_object("markupToggle")
         toolbar = builder.get_object("toolbar")
-        toolbar.get_style_context().add_class("inline-toolbar")
+        toolbar.get_style_context().add_class(Gtk.STYLE_CLASS_INLINE_TOOLBAR)
 
         buttons = ["bold", "italic", "font", "font_fore_color", "back_color"]
         for button in buttons:


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