banshee r3874 - in trunk/banshee: . src/Libraries/Hyena.Gui/Hyena.Widgets



Author: abock
Date: Mon May  5 03:45:26 2008
New Revision: 3874
URL: http://svn.gnome.org/viewvc/banshee?rev=3874&view=rev

Log:
2008-05-04  Aaron Bockover  <abock gnome org>

    * src/Libraries/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs: Added a spin
    entry to change the height for testing; queue a resize when the bar
    height changes



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Widgets/SegmentedBar.cs	Mon May  5 03:45:26 2008
@@ -68,7 +68,7 @@
         }
         
         private List<Segment> segments = new List<Segment> ();
-        private int bar_height = 12;
+        private int bar_height = 25;
         
         private Color remainder_color = CairoExtensions.RgbToColor (0xeeeeee);
     
@@ -112,6 +112,16 @@
                 QueueDraw ();
             }
         }
+        
+        public int BarHeight {
+            get { return bar_height; }
+            set {
+                if (bar_height != value) {
+                    bar_height = value;
+                    QueueResize ();
+                }
+            }
+        }
 
         protected override bool OnExposeEvent (Gdk.EventExpose evnt)
         {
@@ -268,18 +278,34 @@
     internal class SegmentedBarTestModule : Window
     {
         private SegmentedBar bar;
-        
+        private VBox box;
         public SegmentedBarTestModule () : base ("Segmented Bar")
         {
-            bar = new SegmentedBar ();
-            Add (bar);
-            bar.Show ();
             BorderWidth = 30;
             SetDefaultSize (500, -1);
             
+            box = new VBox ();
+            box.Spacing = 10;
+            Add (box);
+            
+            bar = new SegmentedBar ();
             bar.AddSegmentRgb ("Audio", 0.20, 0x3465a4);
             bar.AddSegmentRgb ("Video", 0.55, 0x73d216);
             bar.AddSegmentRgb ("Other", 0.10, 0xf57900);
+            box.PackStart (bar, false, false, 0);
+            box.PackStart (new HSeparator (), false, false, 0);
+            
+            HBox controls = new HBox ();
+            controls.Spacing = 5;
+            box.PackStart (controls, false, false, 0);
+            
+            Label label = new Label ("Height:");
+            controls.PackStart (label, false, false, 0);
+            SpinButton height = new SpinButton (new Adjustment (bar.BarHeight, 5, 100, 1, 1, 1), 1, 0);
+            height.Changed += delegate { bar.BarHeight = height.ValueAsInt; };
+            controls.PackStart (height, false, false, 0);
+            
+            box.ShowAll ();
         }
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]