[longomatch] Keep the zoom widget height synchronized. It should be identical to the scrolledwindow's scrollbar h



commit de58e4b9202c4a11cbe7e6916faf5ac1bb188f99
Author: Julien Moutte <julien fluendo com>
Date:   Fri Oct 17 11:25:09 2014 +0200

    Keep the zoom widget height synchronized.
    It should be identical to the scrolledwindow's scrollbar height. Also invert the HScale to be consistent 
with other widgets in the app (ascending).

 LongoMatch.GUI/Gui/Component/Timeline.cs           |   10 +++-
 .../gtk-gui/LongoMatch.Gui.Component.Timeline.cs   |   46 ++++++++++++-------
 LongoMatch.GUI/gtk-gui/gui.stetic                  |    4 +-
 3 files changed, 39 insertions(+), 21 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/Timeline.cs b/LongoMatch.GUI/Gui/Component/Timeline.cs
index eea9207..e84678b 100644
--- a/LongoMatch.GUI/Gui/Component/Timeline.cs
+++ b/LongoMatch.GUI/Gui/Component/Timeline.cs
@@ -63,12 +63,18 @@ namespace LongoMatch.Gui.Component
                        scrolledwindow1.Vadjustment.ValueChanged += HandleScrollEvent;
                        scrolledwindow1.Hadjustment.ValueChanged += HandleScrollEvent;
                        timeoutID = 0;
+
                        zoominimage.Pixbuf = LongoMatch.Gui.Helpers.Misc.LoadIcon ("longomatch-zoom-in", 14);
                        zoomoutimage.Pixbuf = LongoMatch.Gui.Helpers.Misc.LoadIcon ("longomatch-zoom-out", 
14);
-                       zoominimage.HeightRequest = zoomoutimage.HeightRequest = focusscale.HeightRequest = 
16;
+
+                       // Synchronize the zoom widget height with scrolledwindow's scrollbar's.
+                       scrolledwindow1.HScrollbar.SizeAllocated += (object o, SizeAllocatedArgs args) => {
+                               int spacing = (int) scrolledwindow1.StyleGetProperty ("scrollbar-spacing");
+                               zoomhbox.HeightRequest = args.Allocation.Height + spacing;
+                       };
+
                        menu = new PlaysMenu ();
                        periodsmenu = new PeriodsMenu ();
-                       
                }
 
                protected override void OnDestroyed ()
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.Timeline.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.Timeline.cs
index 3657a61..e2f2da5 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.Timeline.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.Timeline.cs
@@ -5,18 +5,31 @@ namespace LongoMatch.Gui.Component
        public partial class Timeline
        {
                private global::Gtk.HBox hbox1;
+               
                private global::Gtk.VBox leftbox;
+               
                private global::Gtk.HBox hbox2;
+               
                private global::Gtk.Button focusbutton;
+               
                private global::Gtk.Image focusbuttonimage;
+               
                private global::Gtk.DrawingArea labelsarea;
-               private global::Gtk.HBox hbox3;
+               
+               private global::Gtk.HBox zoomhbox;
+               
                private global::Gtk.Image zoominimage;
+               
                private global::Gtk.HScale focusscale;
+               
                private global::Gtk.Image zoomoutimage;
+               
                private global::Gtk.VBox vbox1;
+               
                private global::Gtk.DrawingArea timerulearea;
+               
                private global::Gtk.ScrolledWindow scrolledwindow1;
+               
                private global::Gtk.DrawingArea timelinearea;
 
                protected virtual void Build ()
@@ -43,7 +56,6 @@ namespace LongoMatch.Gui.Component
                        this.focusbuttonimage = new global::Gtk.Image ();
                        this.focusbuttonimage.Name = "focusbuttonimage";
                        this.focusbutton.Add (this.focusbuttonimage);
-                       this.focusbutton.Label = null;
                        this.hbox2.Add (this.focusbutton);
                        global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox2 
[this.focusbutton]));
                        w2.Position = 0;
@@ -59,45 +71,45 @@ namespace LongoMatch.Gui.Component
                        global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.leftbox 
[this.labelsarea]));
                        w4.Position = 1;
                        // Container child leftbox.Gtk.Box+BoxChild
-                       this.hbox3 = new global::Gtk.HBox ();
-                       this.hbox3.Name = "hbox3";
-                       this.hbox3.Spacing = 6;
-                       // Container child hbox3.Gtk.Box+BoxChild
+                       this.zoomhbox = new global::Gtk.HBox ();
+                       this.zoomhbox.Name = "zoomhbox";
+                       this.zoomhbox.Spacing = 6;
+                       // Container child zoomhbox.Gtk.Box+BoxChild
                        this.zoominimage = new global::Gtk.Image ();
                        this.zoominimage.WidthRequest = 14;
                        this.zoominimage.HeightRequest = 8;
                        this.zoominimage.Name = "zoominimage";
-                       this.hbox3.Add (this.zoominimage);
-                       global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox3 
[this.zoominimage]));
+                       this.zoomhbox.Add (this.zoominimage);
+                       global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.zoomhbox 
[this.zoominimage]));
                        w5.Position = 0;
                        w5.Expand = false;
                        w5.Fill = false;
-                       // Container child hbox3.Gtk.Box+BoxChild
+                       // Container child zoomhbox.Gtk.Box+BoxChild
                        this.focusscale = new global::Gtk.HScale (null);
-                       this.focusscale.HeightRequest = 14;
                        this.focusscale.CanFocus = true;
                        this.focusscale.Name = "focusscale";
+                       this.focusscale.Inverted = true;
                        this.focusscale.Adjustment.Upper = 100;
                        this.focusscale.Adjustment.PageIncrement = 10;
                        this.focusscale.Adjustment.StepIncrement = 1;
                        this.focusscale.DrawValue = false;
                        this.focusscale.Digits = 0;
                        this.focusscale.ValuePos = ((global::Gtk.PositionType)(2));
-                       this.hbox3.Add (this.focusscale);
-                       global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.hbox3 
[this.focusscale]));
+                       this.zoomhbox.Add (this.focusscale);
+                       global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.zoomhbox 
[this.focusscale]));
                        w6.Position = 1;
-                       // Container child hbox3.Gtk.Box+BoxChild
+                       // Container child zoomhbox.Gtk.Box+BoxChild
                        this.zoomoutimage = new global::Gtk.Image ();
                        this.zoomoutimage.WidthRequest = 14;
                        this.zoomoutimage.HeightRequest = 8;
                        this.zoomoutimage.Name = "zoomoutimage";
-                       this.hbox3.Add (this.zoomoutimage);
-                       global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.hbox3 
[this.zoomoutimage]));
+                       this.zoomhbox.Add (this.zoomoutimage);
+                       global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.zoomhbox 
[this.zoomoutimage]));
                        w7.Position = 2;
                        w7.Expand = false;
                        w7.Fill = false;
-                       this.leftbox.Add (this.hbox3);
-                       global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.leftbox [this.hbox3]));
+                       this.leftbox.Add (this.zoomhbox);
+                       global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.leftbox 
[this.zoomhbox]));
                        w8.Position = 2;
                        w8.Expand = false;
                        w8.Fill = false;
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index cbcbf04..03f98f2 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -10235,7 +10235,7 @@ You can continue with the current capture, cancel it or save your project.
               </packing>
             </child>
             <child>
-              <widget class="Gtk.HBox" id="hbox3">
+              <widget class="Gtk.HBox" id="zoomhbox">
                 <property name="MemberName" />
                 <property name="Spacing">6</property>
                 <child>
@@ -10254,8 +10254,8 @@ You can continue with the current capture, cancel it or save your project.
                 <child>
                   <widget class="Gtk.HScale" id="focusscale">
                     <property name="MemberName" />
-                    <property name="HeightRequest">14</property>
                     <property name="CanFocus">True</property>
+                    <property name="Inverted">True</property>
                     <property name="Upper">100</property>
                     <property name="PageIncrement">10</property>
                     <property name="StepIncrement">1</property>


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