[pitivi] utils/widgets: Fill sliders with color to indicate the default values
- From: Jean-François Fortin Tam <jfft src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi] utils/widgets: Fill sliders with color to indicate the default values
- Date: Wed, 24 Jul 2013 01:33:56 +0000 (UTC)
commit d9f5364873ae4933e3d3d0dad779f5d79f0fa88c
Author: Jean-François Fortin Tam <nekohayo gmail com>
Date: Tue Jul 23 21:10:56 2013 -0400
utils/widgets: Fill sliders with color to indicate the default values
This provides a visual indication of which numeric values the user has changed.
pitivi/utils/widgets.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/pitivi/utils/widgets.py b/pitivi/utils/widgets.py
index dcab7db..d1a9438 100644
--- a/pitivi/utils/widgets.py
+++ b/pitivi/utils/widgets.py
@@ -224,6 +224,12 @@ class NumericWidget(Gtk.HBox, DynamicWidget):
self.pack_start(self.slider, fill=True, expand=True, padding=0)
self.slider.show()
self.slider.props.draw_value = False
+ # Abuse GTK3's progressbar "fill level" feature to provide
+ # a visual indication of the default value on property sliders.
+ if default is not None:
+ self.slider.set_restrict_to_fill_level(False)
+ self.slider.set_fill_level(float(default))
+ self.slider.set_show_fill_level(True)
if upper is None:
upper = GObject.G_MAXDOUBLE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]