[pitivi] ui/clipproperties.py: Better VPaned management
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] ui/clipproperties.py: Better VPaned management
- Date: Wed, 22 Sep 2010 13:47:33 +0000 (UTC)
commit e79d22064ed452f4fa3abf2c1bb8b87e10ed6558
Author: Thibault Saunier <tsaunier gnome org>
Date: Thu Sep 2 02:29:41 2010 +0200
ui/clipproperties.py: Better VPaned management
pitivi/ui/clipproperties.py | 19 ++++++++++---------
pitivi/ui/effectsconfiguration.py | 2 +-
2 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/pitivi/ui/clipproperties.py b/pitivi/ui/clipproperties.py
index 80eb022..7a861f5 100644
--- a/pitivi/ui/clipproperties.py
+++ b/pitivi/ui/clipproperties.py
@@ -38,6 +38,7 @@ from pitivi.stream import VideoStream
from pitivi.ui.gstwidget import GstElementSettingsWidget
from pitivi.ui.effectsconfiguration import EffectsPropertiesHandling
from pitivi.ui.common import PADDING, SPACING
+from pitivi.ui import dynamic
(COL_ACTIVATED,
COL_TYPE,
@@ -45,6 +46,8 @@ from pitivi.ui.common import PADDING, SPACING
COL_DESC_TEXT,
COL_TRACK_EFFECT) = range(5)
+VPANED_DEFAULT_POSITION = 30
+
class ClipPropertiesError(Exception):
"""Base Exception for errors happening in L{ClipProperties}s or L{EffectProperties}s"""
pass
@@ -120,7 +123,7 @@ class EffectProperties(gtk.HBox):
self.effect_props_handling = effect_properties_handling
self.clip_properties = clip_properties
self._info_bar = None
- self._config_ui_h_pos = {}
+ self._config_ui_h_pos = None
self._timeline = None
self._vcontent = gtk.VPaned()
@@ -267,8 +270,6 @@ class EffectProperties(gtk.HBox):
def _cleanCache(self, effect):
element = effect.getElement()
config_ui = self.effect_props_handling.cleanCache(element)
- if self._config_ui_h_pos.has_key(config_ui):
- self._config_ui_h_pos.pop(config_ui)
def addEffectToCurrentSelection(self, factory_name):
if self.timeline_objects:
@@ -386,7 +387,7 @@ class EffectProperties(gtk.HBox):
def _updateEffectConfigUi(self):
if self._effect_config_ui is not None:
- self._config_ui_h_pos[self._effect_config_ui] = self._vcontent.get_position()
+ self._config_ui_h_pos = self._vcontent.get_position()
if self.selection.get_selected()[1]:
track_effect = self.storemodel.get_value(self.selection.get_selected()[1],
COL_TRACK_EFFECT)
@@ -397,16 +398,16 @@ class EffectProperties(gtk.HBox):
element = track_effect.getElement()
ui = self.effect_props_handling.getEffectConfigurationUI(element)
+
self._effect_config_ui = ui
if self._effect_config_ui:
self._vcontent.pack2(self._effect_config_ui,
resize=False,
shrink=False)
- if self._config_ui_h_pos.has_key(self._effect_config_ui):
- position = self._config_ui_h_pos.get(self._effect_config_ui)
- self._vcontent.set_position(int(position))
+ if self._config_ui_h_pos:
+ self._vcontent.set_position(int(self._config_ui_h_pos))
else:
- self._vcontent.set_position(10)
+ self._vcontent.set_position(VPANED_DEFAULT_POSITION)
self._effect_config_ui.show_all()
self.selected_on_treeview = track_effect
@@ -415,6 +416,6 @@ class EffectProperties(gtk.HBox):
def _hideEffectConfig(self):
if self._effect_config_ui:
- self._config_ui_h_pos[self._effect_config_ui] = self._vcontent.get_position()
+ self._config_ui_h_pos = self._vcontent.get_position()
self._effect_config_ui.hide()
self._effect_config_ui = None
diff --git a/pitivi/ui/effectsconfiguration.py b/pitivi/ui/effectsconfiguration.py
index 624d589..88e43e9 100644
--- a/pitivi/ui/effectsconfiguration.py
+++ b/pitivi/ui/effectsconfiguration.py
@@ -53,7 +53,7 @@ class EffectsPropertiesHandling:
effect_set_ui.setElement(effect, ignore=PROPS_TO_IGNORE,
default_btn=True, use_element_props=True)
nb_rows = effect_set_ui.get_children()[0].get_property('n-rows')
- if nb_rows > 4:
+ if nb_rows > 2:
effect_configuration_ui = gtk.ScrolledWindow()
effect_configuration_ui.add_with_viewport(effect_set_ui)
self.cache_dict[effect] = effect_configuration_ui
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]