Make Gtk.HScales step in increments of 1 instead of 10
authorPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 1 Mar 2010 07:15:33 +0000 (08:15 +0100)
committerPhilipp Zabel <philipp.zabel@gmail.com>
Mon, 1 Mar 2010 07:15:33 +0000 (08:15 +0100)
src/led-command-widget.vala

index c4fb0df..158e47a 100644 (file)
@@ -107,6 +107,7 @@ class LedCommandWidget : Gtk.HBox {
                content.pack_start (lpv, true, true, 0);
 
                var scale1 = new Gtk.HScale.with_range (1, 62, 1);
+               scale1.set_increments (1, 1);
                var v = (command.step_time / 16 / CYCLE_TIME_MS);
                if (v > 62)
                        v = v / 32 + 31;
@@ -145,6 +146,7 @@ class LedCommandWidget : Gtk.HBox {
                hbox2.pack_start (radio_dec, false, false, 0);
                hbox.pack_start (hbox2, false, false, 0);
                var scale2 = new Gtk.HScale.with_range (0, 255, 1);
+               scale2.set_increments (1, 1);
                scale2.set_value ((command.steps < 0) ? -command.steps : command.steps);
                scale2.set_value_pos (Gtk.PositionType.RIGHT);
                scale2.format_value.connect ((v) => {
@@ -193,6 +195,7 @@ class LedCommandWidget : Gtk.HBox {
                content.pack_start (lpv, true, true, 0);
 
                var scale = new Gtk.HScale.with_range (0, 255, 1);
+               scale.set_increments (1, 1);
                scale.set_value (command.level);
                scale.value_changed.connect ((s) => {
                        command.set_pwm ((int) s.get_value ());