gnome-scan r701 - in trunk: . lib
- From: bersace svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-scan r701 - in trunk: . lib
- Date: Mon, 15 Dec 2008 22:27:15 +0000 (UTC)
Author: bersace
Date: Mon Dec 15 22:27:14 2008
New Revision: 701
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=701&view=rev
Log:
Don't set option upon widget construction.
Modified:
trunk/ChangeLog
trunk/lib/gnome-scan-entry-widget.vala
trunk/lib/gnome-scan-scale-widget.vala
Modified: trunk/lib/gnome-scan-entry-widget.vala
==============================================================================
--- trunk/lib/gnome-scan-entry-widget.vala (original)
+++ trunk/lib/gnome-scan-entry-widget.vala Mon Dec 15 22:27:14 2008
@@ -30,10 +30,10 @@
var option = this.option as OptionString;
entry = new Entry();
- entry.changed += this.on_entry_changed;
entry.text = option.value;
this.pack_start(entry, true, true, 0);
+ entry.changed += this.on_entry_changed;
option.notify["value"] += this.on_option_changed;
}
Modified: trunk/lib/gnome-scan-scale-widget.vala
==============================================================================
--- trunk/lib/gnome-scan-scale-widget.vala (original)
+++ trunk/lib/gnome-scan-scale-widget.vala Mon Dec 15 22:27:14 2008
@@ -31,29 +31,41 @@
this.no_label = false;
SpinButton spin;
+ Scale scale;
int digits = 0;
if (option is OptionInt) {
var option = this.option as OptionInt;
+
adj = new Adjustment(option.value, option.min, option.max, option.step, option.step, 0);
+
+ scale = new HScale(adj);
+ scale.draw_value = false;
+ scale.set_digits(digits);
+
+ spin = new SpinButton(adj, option.step, digits);
+
adj.value_changed += this.on_int_adj_value_changed;
- spin = new SpinButton(adj, option.step, 0);
option.notify["value"] += this.on_int_option_value_changed;
}
else if (option is OptionDouble) {
var option = this.option as OptionDouble;
+
if (option.step < 1.0)
digits = 2;
+
adj = new Adjustment(option.value, option.min, option.max, option.step, option.step, 0);
- adj.value_changed += this.on_double_adj_value_changed;
+
+ scale = new HScale(adj);
+ scale.draw_value = false;
+ scale.set_digits(digits);
+
spin = new SpinButton(adj, option.step, digits);
+
+ adj.value_changed += this.on_double_adj_value_changed;
option.notify["value"] += this.on_double_option_value_changed;
}
- var scale = new HScale(adj);
- scale.draw_value = false;
- scale.set_digits(digits);
this.pack_start(scale, true, true, 0);
-
this.pack_start(spin, false, true, 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]