Bigger buttons, bigger steps
authorEnrico Zini <enrico@enricozini.org>
Mon, 17 Aug 2009 20:17:16 +0000 (21:17 +0100)
committerEnrico Zini <enrico@enricozini.org>
Mon, 17 Aug 2009 20:17:16 +0000 (21:17 +0100)
src/app_main.vala

index 478a2ebb0a7d489c2ec50958403582f21ad5cbb4..86566e57b6fe07789b4773db10e27aa684e96586 100644 (file)
@@ -137,26 +137,46 @@ public class Status : Applet
        }
 }
 
-public class IncDec : Gtk.HButtonBox
+public class IncDec : Gtk.HBox
 {
+    protected Gtk.Button b_decmore;
     protected Gtk.Button b_dec;
     protected Gtk.Button b_inc;
+    protected Gtk.Button b_incmore;
+    static const int BH = 40;
+    static const int BW = 40;
 
     public signal void tweaked(IncDec id, int amount);
 
     public IncDec()
     {
-        b_dec = new Gtk.Button.with_label("-");
-        b_inc = new Gtk.Button.with_label("+");
-        pack_start(b_dec, false, false, 0);
-        pack_start(b_inc, false, false, 0);
+        homogeneous = true;
+        b_decmore = new Gtk.Button.with_label("«");
+               b_decmore.set_size_request(BW, BH);
+        b_dec = new Gtk.Button.with_label("<");
+               b_dec.set_size_request(BW, BH);
+        b_inc = new Gtk.Button.with_label(">");
+               b_inc.set_size_request(BW, BH);
+        b_incmore = new Gtk.Button.with_label("»");
+               b_incmore.set_size_request(BW, BH);
+        pack_start(b_decmore, false, true, 0);
+        pack_start(b_dec, false, true, 0);
+        pack_start(b_inc, false, true, 0);
+        pack_start(b_incmore, false, true, 0);
         b_dec.clicked += on_clicked;
         b_inc.clicked += on_clicked;
     }
 
     protected void on_clicked(Gtk.Button b)
     {
-        tweaked(this, b == b_dec ? -1 : 1);
+        if (b == b_decmore)
+            tweaked(this, -10);
+        else if (b == b_dec)
+            tweaked(this, -1);
+        else if (b == b_inc)
+            tweaked(this, 1);
+        else if (b == b_incmore)
+            tweaked(this, 10);
     }
 }