[pitivi] clipproperties/widgets : switch to using a CheckButton.
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] clipproperties/widgets : switch to using a CheckButton.
- Date: Mon, 8 Jul 2013 00:52:12 +0000 (UTC)
commit 50617c47852f0a7053132ad0f65658d6dad1b2db
Author: Mathieu Duponchelle <mathieu duponchelle epitech eu>
Date: Wed Jun 26 00:15:18 2013 +0200
clipproperties/widgets : switch to using a CheckButton.
+ Also fix behaviour for hiding keyframes.
pitivi/clipproperties.py | 3 +++
pitivi/utils/widgets.py | 28 +++++++++++++++++-----------
2 files changed, 20 insertions(+), 11 deletions(-)
---
diff --git a/pitivi/clipproperties.py b/pitivi/clipproperties.py
index 1cf400c..69031d6 100644
--- a/pitivi/clipproperties.py
+++ b/pitivi/clipproperties.py
@@ -447,6 +447,9 @@ class EffectProperties(Gtk.Expander, Loggable):
element = effect
ui = self.effect_props_handling.getEffectConfigurationUI(element)
+ if self._effect_config_ui:
+ self._effect_config_ui.get_children()[0].get_children()[0].resetShowKeyframesButton()
+
self._effect_config_ui = ui
if self._effect_config_ui:
self._vcontent.pack2(self._effect_config_ui, resize=False, shrink=False)
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index 77a09dc..d75f0fc 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -819,6 +819,14 @@ class GstElementSettingsWidget(Gtk.VBox, Loggable):
self.properties = None
self.buttons = {}
+ def resetShowKeyframesButton(self):
+ effect = self.element
+ for but in self.showKeyframesButtons:
+ but.set_active(False)
+ for track_element in effect.get_parent().get_children():
+ if hasattr(track_element, "ui_element"):
+ track_element.ui_element.hideKeyframes()
+
def setElement(self, element, properties={}, ignore=['name'],
default_btn=False, use_element_props=False):
"""
@@ -929,13 +937,9 @@ class GstElementSettingsWidget(Gtk.VBox, Loggable):
widget.setWidgetValue(self.element.get_property(pspec.name))
def _getShowKeyframesButton(self, prop):
- icon = Gtk.Image()
- icon.set_from_icon_name("document-properties-symbolic", Gtk.IconSize.MENU)
- button = Gtk.Button()
- button.add(icon)
+ button = Gtk.CheckButton()
button.set_tooltip_text(_("Show keyframes for this value"))
- button.set_relief(Gtk.ReliefStyle.NONE)
- button.connect('clicked', self._showKeyframesClickedCb, prop)
+ button.connect('toggled', self._showKeyframesClickedCb, prop)
return button
def _getResetToDefaultValueButton(self, prop, widget):
@@ -949,16 +953,18 @@ class GstElementSettingsWidget(Gtk.VBox, Loggable):
return button
def _showKeyframesClickedCb(self, button, prop):
+ active = button.get_active()
for but in self.showKeyframesButtons:
- but.set_relief(Gtk.ReliefStyle.NONE)
-
- button.set_relief(Gtk.ReliefStyle.HALF)
-
+ if but != button:
+ but.set_active(False)
effect = self.element
track_type = effect.get_track_type()
+ button.set_active(active)
for track_element in effect.get_parent().get_children():
- if hasattr(track_element, "ui_element") and track_type == track_element.get_track_type():
+ if hasattr(track_element, "ui_element") and track_type == track_element.get_track_type() and
active:
track_element.ui_element.showKeyframes(effect, prop)
+ elif hasattr(track_element, "ui_element"):
+ track_element.ui_element.hideKeyframes()
def _defaultBtnClickedCb(self, button, widget):
binding = self.bindings[widget]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]