[pitivi] dynamic.py: add a widget for inputing resolutions
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] dynamic.py: add a widget for inputing resolutions
- Date: Tue, 17 Aug 2010 07:07:27 +0000 (UTC)
commit d7a45dbdec68137f1aab8f04e3f6c50c312da7b6
Author: Brandon Lewis <brandon_lewis alum berkeley edu>
Date: Fri Mar 26 18:55:18 2010 -0700
dynamic.py: add a widget for inputing resolutions
pitivi/ui/dynamic.py | 32 +++++++++++++++++++++++++++++++-
1 files changed, 31 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/ui/dynamic.py b/pitivi/ui/dynamic.py
index 73621d2..ce101aa 100644
--- a/pitivi/ui/dynamic.py
+++ b/pitivi/ui/dynamic.py
@@ -164,7 +164,7 @@ class NumericWidget(gtk.HBox):
self.adjustment.props.lower = lower
self.adjustment.props.upper = upper
self.spinner = gtk.SpinButton(self.adjustment)
- self.pack_start(self.spinner, False, False)
+ self.pack_start(self.spinner)
self.spinner.show()
def connectValueChanged(self, callback, *args):
@@ -378,6 +378,36 @@ class FontWidget(gtk.FontButton):
def getWidgetValue(self):
return self.get_font_name()
+class ResolutionWidget(gtk.HBox):
+
+ def __init__ (self):
+ gtk.HBox.__init__(self)
+ self.props.spacing = 6
+
+ self.dwidth = 0
+ self.dheight = 0
+ self.dwidthWidget = NumericWidget(lower=0)
+ self.dheightWidget = NumericWidget(lower=0)
+ self.pack_start(self.dwidthWidget)
+ self.pack_start(gtk.Label("x"))
+ self.pack_start(self.dheightWidget)
+ self.setWidgetValue((320, 240))
+ self.show_all()
+
+ def connectValueChanged(self, callback, *args):
+ self.dwidthWidget.connectValueChanged(callback, *args)
+ self.dheightWidget.connectValueChanged(callback, *args)
+
+ def setWidgetValue(self, value):
+ width, height = value
+ dar = gst.Fraction(width, height)
+
+ self.dwidthWidget.setWidgetValue(width)
+ self.dheightWidget.setWidgetValue(height)
+
+ def getWidgetValue(self):
+ pass
+
if __name__ == '__main__':
def valueChanged(unused_widget, widget, target):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]