[longomatch] Load the button image using our helper function to maintain aspect ratio on all platforms.



commit fdda813ce53737fcb58791ab2c9ec87a247cdbf6
Author: Julien Moutte <julien fluendo com>
Date:   Tue Sep 9 18:35:20 2014 +0200

    Load the button image using our helper function to maintain aspect ratio on all platforms.

 LongoMatch.GUI/Gui/Component/DatePicker.cs         |    3 ++
 LongoMatch.GUI/Gui/Component/MediaFileChooser.cs   |    3 ++
 .../gtk-gui/LongoMatch.Gui.Component.DatePicker.cs |   27 ++++++-------------
 .../LongoMatch.Gui.Component.MediaFileChooser.cs   |   27 ++++++-------------
 LongoMatch.GUI/gtk-gui/gui.stetic                  |   24 ++++++++++-------
 5 files changed, 38 insertions(+), 46 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/DatePicker.cs b/LongoMatch.GUI/Gui/Component/DatePicker.cs
index 99d5406..e6a6295 100644
--- a/LongoMatch.GUI/Gui/Component/DatePicker.cs
+++ b/LongoMatch.GUI/Gui/Component/DatePicker.cs
@@ -29,6 +29,9 @@ namespace LongoMatch.Gui.Component
                public DatePicker ()
                {
                        this.Build ();
+
+                       datebuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-calendar", 
Gtk.IconSize.Button, 0);
+
                        datebutton.Clicked += HandleClicked;
                        dateentry.Changed += HandleChanged;
                        Date = DateTime.Now;
diff --git a/LongoMatch.GUI/Gui/Component/MediaFileChooser.cs 
b/LongoMatch.GUI/Gui/Component/MediaFileChooser.cs
index 4a1e33d..f1cd9d4 100644
--- a/LongoMatch.GUI/Gui/Component/MediaFileChooser.cs
+++ b/LongoMatch.GUI/Gui/Component/MediaFileChooser.cs
@@ -33,6 +33,9 @@ namespace LongoMatch.Gui.Component
                public MediaFileChooser ()
                {
                        this.Build ();
+
+                       addbuttonimage.Pixbuf = Helpers.Misc.LoadIcon ("longomatch-browse", 
Gtk.IconSize.Button, 0);
+
                        MediaFileMode = true;
                        UpdateFile ();
                        addbutton.Clicked += HandleClicked;
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs
index 22323d4..9790399 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs
@@ -8,6 +8,7 @@ namespace LongoMatch.Gui.Component
                private global::Gtk.HBox hbox2;
                private global::Gtk.Entry dateentry;
                private global::Gtk.Button datebutton;
+               private global::Gtk.Image datebuttonimage;
 
                protected virtual void Build ()
                {
@@ -36,26 +37,16 @@ namespace LongoMatch.Gui.Component
                        this.datebutton = new global::Gtk.Button ();
                        this.datebutton.CanFocus = true;
                        this.datebutton.Name = "datebutton";
-                       this.datebutton.UseUnderline = true;
                        // Container child datebutton.Gtk.Container+ContainerChild
-                       global::Gtk.Alignment w2 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
-                       // Container child GtkAlignment.Gtk.Container+ContainerChild
-                       global::Gtk.HBox w3 = new global::Gtk.HBox ();
-                       w3.Spacing = 2;
-                       // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Image w4 = new global::Gtk.Image ();
-                       w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "longomatch-calendar", 
global::Gtk.IconSize.Button);
-                       w3.Add (w4);
-                       // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Label w6 = new global::Gtk.Label ();
-                       w3.Add (w6);
-                       w2.Add (w3);
-                       this.datebutton.Add (w2);
+                       this.datebuttonimage = new global::Gtk.Image ();
+                       this.datebuttonimage.Name = "datebuttonimage";
+                       this.datebutton.Add (this.datebuttonimage);
+                       this.datebutton.Label = null;
                        this.hbox2.Add (this.datebutton);
-                       global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox2 
[this.datebutton]));
-                       w10.Position = 1;
-                       w10.Expand = false;
-                       w10.Fill = false;
+                       global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox2 
[this.datebutton]));
+                       w3.Position = 1;
+                       w3.Expand = false;
+                       w3.Fill = false;
                        this.dateentryeventbox.Add (this.hbox2);
                        this.Add (this.dateentryeventbox);
                        if ((this.Child != null)) {
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs
index 208b3ea..bc39bf7 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs
@@ -8,6 +8,7 @@ namespace LongoMatch.Gui.Component
                private global::Gtk.HBox hbox1;
                private global::Gtk.Entry fileentry;
                private global::Gtk.Button addbutton;
+               private global::Gtk.Image addbuttonimage;
 
                protected virtual void Build ()
                {
@@ -36,26 +37,16 @@ namespace LongoMatch.Gui.Component
                        this.addbutton = new global::Gtk.Button ();
                        this.addbutton.CanFocus = true;
                        this.addbutton.Name = "addbutton";
-                       this.addbutton.UseUnderline = true;
                        // Container child addbutton.Gtk.Container+ContainerChild
-                       global::Gtk.Alignment w2 = new global::Gtk.Alignment (0.5F, 0.5F, 0F, 0F);
-                       // Container child GtkAlignment.Gtk.Container+ContainerChild
-                       global::Gtk.HBox w3 = new global::Gtk.HBox ();
-                       w3.Spacing = 2;
-                       // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Image w4 = new global::Gtk.Image ();
-                       w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "longomatch-browse", 
global::Gtk.IconSize.Button);
-                       w3.Add (w4);
-                       // Container child GtkHBox.Gtk.Container+ContainerChild
-                       global::Gtk.Label w6 = new global::Gtk.Label ();
-                       w3.Add (w6);
-                       w2.Add (w3);
-                       this.addbutton.Add (w2);
+                       this.addbuttonimage = new global::Gtk.Image ();
+                       this.addbuttonimage.Name = "addbuttonimage";
+                       this.addbutton.Add (this.addbuttonimage);
+                       this.addbutton.Label = null;
                        this.hbox1.Add (this.addbutton);
-                       global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1 
[this.addbutton]));
-                       w10.Position = 1;
-                       w10.Expand = false;
-                       w10.Fill = false;
+                       global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 
[this.addbutton]));
+                       w3.Position = 1;
+                       w3.Expand = false;
+                       w3.Fill = false;
                        this.fileentryeventbox.Add (this.hbox1);
                        this.Add (this.fileentryeventbox);
                        if ((this.Child != null)) {
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index fb41391..e428b77 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -10356,7 +10356,7 @@ You can continue with the current capture, cancel it or save your project.
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.MediaFileChooser" design-size="300 33">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.MediaFileChooser" design-size="300 64">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
@@ -10383,10 +10383,12 @@ You can continue with the current capture, cancel it or save your project.
               <widget class="Gtk.Button" id="addbutton">
                 <property name="MemberName" />
                 <property name="CanFocus">True</property>
-                <property name="Type">TextAndIcon</property>
-                <property name="Icon">stock:longomatch-browse Button</property>
-                <property name="Label" translatable="yes" />
-                <property name="UseUnderline">True</property>
+                <property name="Type">Custom</property>
+                <child>
+                  <widget class="Gtk.Image" id="addbuttonimage">
+                    <property name="MemberName" />
+                  </widget>
+                </child>
               </widget>
               <packing>
                 <property name="Position">1</property>
@@ -10400,7 +10402,7 @@ You can continue with the current capture, cancel it or save your project.
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.DatePicker" design-size="300 34">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.DatePicker" design-size="300 64">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
@@ -10427,10 +10429,12 @@ You can continue with the current capture, cancel it or save your project.
               <widget class="Gtk.Button" id="datebutton">
                 <property name="MemberName" />
                 <property name="CanFocus">True</property>
-                <property name="Type">TextAndIcon</property>
-                <property name="Icon">stock:longomatch-calendar Button</property>
-                <property name="Label" translatable="yes" />
-                <property name="UseUnderline">True</property>
+                <property name="Type">Custom</property>
+                <child>
+                  <widget class="Gtk.Image" id="datebuttonimage">
+                    <property name="MemberName" />
+                  </widget>
+                </child>
               </widget>
               <packing>
                 <property name="Position">1</property>


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