[longomatch] Embed datepicker and filechooser in an event box to ease theming and make the button widget belong t



commit 631072f7e96f3cff94953a853f8e2b7a82209415
Author: Julien Moutte <julien fluendo com>
Date:   Mon Sep 1 11:40:00 2014 +0200

    Embed datepicker and filechooser in an event box to ease theming and make the button widget belong to the 
composite widget.

 .../gtk-gui/LongoMatch.Gui.Component.DatePicker.cs |    9 ++-
 .../LongoMatch.Gui.Component.MediaFileChooser.cs   |    9 ++-
 LongoMatch.GUI/gtk-gui/gui.stetic                  |  116 +++++++++++---------
 data/theme/gtk-2.0/entry.rc                        |   77 +++++++++++++
 data/theme/gtk-2.0/gtkrc                           |  102 +----------------
 5 files changed, 163 insertions(+), 150 deletions(-)
---
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs
index f5fa8ed..22323d4 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.DatePicker.cs
@@ -4,6 +4,7 @@ namespace LongoMatch.Gui.Component
 {
        public partial class DatePicker
        {
+               private global::Gtk.EventBox dateentryeventbox;
                private global::Gtk.HBox hbox2;
                private global::Gtk.Entry dateentry;
                private global::Gtk.Button datebutton;
@@ -15,13 +16,18 @@ namespace LongoMatch.Gui.Component
                        global::Stetic.BinContainer.Attach (this);
                        this.Name = "LongoMatch.Gui.Component.DatePicker";
                        // Container child LongoMatch.Gui.Component.DatePicker.Gtk.Container+ContainerChild
+                       this.dateentryeventbox = new global::Gtk.EventBox ();
+                       this.dateentryeventbox.Name = "dateentryeventbox";
+                       // Container child dateentryeventbox.Gtk.Container+ContainerChild
                        this.hbox2 = new global::Gtk.HBox ();
                        this.hbox2.Name = "hbox2";
+                       this.hbox2.BorderWidth = ((uint)(2));
                        // Container child hbox2.Gtk.Box+BoxChild
                        this.dateentry = new global::Gtk.Entry ();
                        this.dateentry.CanFocus = true;
                        this.dateentry.Name = "dateentry";
                        this.dateentry.IsEditable = false;
+                       this.dateentry.HasFrame = false;
                        this.dateentry.InvisibleChar = '•';
                        this.hbox2.Add (this.dateentry);
                        global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox2 
[this.dateentry]));
@@ -50,7 +56,8 @@ namespace LongoMatch.Gui.Component
                        w10.Position = 1;
                        w10.Expand = false;
                        w10.Fill = false;
-                       this.Add (this.hbox2);
+                       this.dateentryeventbox.Add (this.hbox2);
+                       this.Add (this.dateentryeventbox);
                        if ((this.Child != null)) {
                                this.Child.ShowAll ();
                        }
diff --git a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs 
b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs
index 9a70e96..208b3ea 100644
--- a/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs
+++ b/LongoMatch.GUI/gtk-gui/LongoMatch.Gui.Component.MediaFileChooser.cs
@@ -4,6 +4,7 @@ namespace LongoMatch.Gui.Component
 {
        public partial class MediaFileChooser
        {
+               private global::Gtk.EventBox fileentryeventbox;
                private global::Gtk.HBox hbox1;
                private global::Gtk.Entry fileentry;
                private global::Gtk.Button addbutton;
@@ -15,13 +16,18 @@ namespace LongoMatch.Gui.Component
                        global::Stetic.BinContainer.Attach (this);
                        this.Name = "LongoMatch.Gui.Component.MediaFileChooser";
                        // Container child 
LongoMatch.Gui.Component.MediaFileChooser.Gtk.Container+ContainerChild
+                       this.fileentryeventbox = new global::Gtk.EventBox ();
+                       this.fileentryeventbox.Name = "fileentryeventbox";
+                       // Container child fileentryeventbox.Gtk.Container+ContainerChild
                        this.hbox1 = new global::Gtk.HBox ();
                        this.hbox1.Name = "hbox1";
+                       this.hbox1.BorderWidth = ((uint)(2));
                        // Container child hbox1.Gtk.Box+BoxChild
                        this.fileentry = new global::Gtk.Entry ();
                        this.fileentry.CanFocus = true;
                        this.fileentry.Name = "fileentry";
                        this.fileentry.IsEditable = false;
+                       this.fileentry.HasFrame = false;
                        this.fileentry.InvisibleChar = '•';
                        this.hbox1.Add (this.fileentry);
                        global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox1 
[this.fileentry]));
@@ -50,7 +56,8 @@ namespace LongoMatch.Gui.Component
                        w10.Position = 1;
                        w10.Expand = false;
                        w10.Fill = false;
-                       this.Add (this.hbox1);
+                       this.fileentryeventbox.Add (this.hbox1);
+                       this.Add (this.fileentryeventbox);
                        if ((this.Child != null)) {
                                this.Child.ShowAll ();
                        }
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index 811eeda..279638e 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -10225,39 +10225,46 @@ 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 29">
+  <widget class="Gtk.Bin" id="LongoMatch.Gui.Component.MediaFileChooser" design-size="300 33">
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
-      <widget class="Gtk.HBox" id="hbox1">
+      <widget class="Gtk.EventBox" id="fileentryeventbox">
         <property name="MemberName" />
         <child>
-          <widget class="Gtk.Entry" id="fileentry">
-            <property name="MemberName" />
-            <property name="CanFocus">True</property>
-            <property name="IsEditable">False</property>
-            <property name="InvisibleChar">•</property>
-          </widget>
-          <packing>
-            <property name="Position">0</property>
-            <property name="AutoSize">True</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="Gtk.Button" id="addbutton">
+          <widget class="Gtk.HBox" id="hbox1">
             <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="BorderWidth">2</property>
+            <child>
+              <widget class="Gtk.Entry" id="fileentry">
+                <property name="MemberName" />
+                <property name="CanFocus">True</property>
+                <property name="IsEditable">False</property>
+                <property name="HasFrame">False</property>
+                <property name="InvisibleChar">•</property>
+              </widget>
+              <packing>
+                <property name="Position">0</property>
+                <property name="AutoSize">True</property>
+              </packing>
+            </child>
+            <child>
+              <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>
+              </widget>
+              <packing>
+                <property name="Position">1</property>
+                <property name="AutoSize">True</property>
+                <property name="Expand">False</property>
+                <property name="Fill">False</property>
+              </packing>
+            </child>
           </widget>
-          <packing>
-            <property name="Position">1</property>
-            <property name="AutoSize">True</property>
-            <property name="Expand">False</property>
-            <property name="Fill">False</property>
-          </packing>
         </child>
       </widget>
     </child>
@@ -10266,35 +10273,42 @@ You can continue with the current capture, cancel it or save your project.
     <property name="MemberName" />
     <property name="Visible">False</property>
     <child>
-      <widget class="Gtk.HBox" id="hbox2">
+      <widget class="Gtk.EventBox" id="dateentryeventbox">
         <property name="MemberName" />
         <child>
-          <widget class="Gtk.Entry" id="dateentry">
-            <property name="MemberName" />
-            <property name="CanFocus">True</property>
-            <property name="IsEditable">False</property>
-            <property name="InvisibleChar">•</property>
-          </widget>
-          <packing>
-            <property name="Position">0</property>
-            <property name="AutoSize">True</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="Gtk.Button" id="datebutton">
+          <widget class="Gtk.HBox" id="hbox2">
             <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="BorderWidth">2</property>
+            <child>
+              <widget class="Gtk.Entry" id="dateentry">
+                <property name="MemberName" />
+                <property name="CanFocus">True</property>
+                <property name="IsEditable">False</property>
+                <property name="HasFrame">False</property>
+                <property name="InvisibleChar">•</property>
+              </widget>
+              <packing>
+                <property name="Position">0</property>
+                <property name="AutoSize">True</property>
+              </packing>
+            </child>
+            <child>
+              <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>
+              </widget>
+              <packing>
+                <property name="Position">1</property>
+                <property name="AutoSize">True</property>
+                <property name="Expand">False</property>
+                <property name="Fill">False</property>
+              </packing>
+            </child>
           </widget>
-          <packing>
-            <property name="Position">1</property>
-            <property name="AutoSize">True</property>
-            <property name="Expand">False</property>
-            <property name="Fill">False</property>
-          </packing>
         </child>
       </widget>
     </child>
diff --git a/data/theme/gtk-2.0/entry.rc b/data/theme/gtk-2.0/entry.rc
new file mode 100644
index 0000000..427a082
--- /dev/null
+++ b/data/theme/gtk-2.0/entry.rc
@@ -0,0 +1,77 @@
+
+style "longomatch-default-entry" = "longomatch-default" {
+
+  font = "Ubuntu 12"
+  xthickness = 2
+  ythickness = 2
+
+  base[NORMAL]        = @bg_dark_color
+  base[INSENSITIVE]   = darker (@bg_dark_color)
+
+  text[NORMAL]      = @text_color
+  text[INSENSITIVE] = darker (@text_color)
+}
+
+style "longomatch-entry" = "longomatch-default-entry" {
+  engine "clearlooks"
+  {
+    radius = 1.0
+  }
+}
+
+style "longomatch-custom-entry" = "longomatch-default-entry" {
+  xthickness = 2
+  ythickness = 2
+
+  engine "pixmap"
+  {
+     image
+     {
+       function        = FLAT_BOX
+       state           = NORMAL
+       detail          = "eventbox"
+       file            = "Entry/combo-entry-border-bg.png"
+       border          = { 4, 4, 4, 4 }
+       stretch         = TRUE
+     }
+     image
+     {
+       function        = FLAT_BOX
+       state           = INSENSITIVE
+       detail          = "eventbox"
+       file            = "Entry/combo-entry-border-bg-insensitive.png"
+       border          = { 4, 4, 4, 4 }
+       stretch         = TRUE
+     }
+  }
+}
+
+style "longomatch-custom-entry-children" {
+  engine "pixmap"
+  {
+    image
+    {
+      function  = BOX
+      state     = NORMAL
+      file      = "Buttons/button-entry-default.svg"
+      border    = { 4, 4, 4, 4 }
+      stretch   = TRUE
+    }
+    image
+    {
+      function  = BOX
+      state     = PRELIGHT
+      file      = "Buttons/button-entry-prelight.svg"
+      border    = { 4, 4, 4, 4 }
+      stretch   = TRUE
+    }
+    image
+    {
+      function  = BOX
+      state     = SELECTED
+      file      = "Buttons/button-entry-pressed.svg"
+      border    = { 4, 4, 4, 4 }
+      stretch   = TRUE
+    }
+  }
+}
diff --git a/data/theme/gtk-2.0/gtkrc b/data/theme/gtk-2.0/gtkrc
index 72570a0..3f09904 100644
--- a/data/theme/gtk-2.0/gtkrc
+++ b/data/theme/gtk-2.0/gtkrc
@@ -66,24 +66,6 @@ style "longomatch-default"
   }
 }
 
-style "longomatch-entry" = "longomatch-default" {
-
-  font = "Ubuntu 12"
-  xthickness = 2
-  ythickness = 2
-
-  base[NORMAL]        = @bg_dark_color
-  base[INSENSITIVE]   = darker (@bg_dark_color)
-
-  text[NORMAL]      = @text_color
-  text[INSENSITIVE] = darker (@text_color)
-
-  engine "clearlooks"
-  {
-    radius = 1.0
-  }
-}
-
 style "longomatch-header" {
   base[NORMAL]      = @bg_light_color
   bg[NORMAL]        = @bg_light_color
@@ -134,80 +116,6 @@ style "longomatch-menuitem" {
   bg[PRELIGHT]       = @bg_color
 }
 
-style "longomatch-filechooser-entry"
-{
-   base[NORMAL] = @bg_color
-   base[INSENSITIVE] = @bg_color
-
-   xthickness = 15
-   ythickness = 4
-
-   engine "pixmap"
-   {
-     image
-     {
-       function  = SHADOW
-       detail    = "entry"
-       state     = NORMAL
-       shadow    = IN
-       file      = "Entry/file-input-left.png"
-       border    = { 15, 4, 15, 15 }
-       stretch   = TRUE
-     }
-     image
-     {
-       function        = FLAT_BOX
-       detail          = "entry_bg"
-       state           = NORMAL
-       overlay_file    = "Entry/filechooser-entry-fill.png"
-       overlay_border  = { 0, 0, 0, 0 }
-       overlay_stretch = TRUE
-     }
-   }
-}
-
-style "longomatch-filechooser-button"
-{
-   ythickness = 3
-   xthickness = 10
-
-   engine "pixmap"
-   {
-    image
-    {
-      function  = BOX
-      state     = NORMAL
-      file      = "Buttons/filechooser-default.png"
-      border    = { 4, 4, 4, 4 }
-      stretch   = TRUE
-    }
-    image
-    {
-      function   = BOX
-      state      = PRELIGHT
-      file       = "Buttons/filechooser-prelight.png"
-      border     = { 4, 4, 4, 4 }
-      stretch    = TRUE
-    }
-    image
-    {
-      function   = BOX
-      state      = ACTIVE
-      file       = "Buttons/filechooser-pressed.png"
-      border     = { 4, 4, 4, 4 }
-      stretch    = TRUE
-    }
-    image
-    {
-      function   = BOX
-      state      = INSENSITIVE
-      file       = "Buttons/filechooser-default.png"
-      border     = { 4, 4, 4, 4 }
-      stretch    = TRUE
-    }
-   }
-}
-
 style "longomatch-aspect-frame"
 {
   xthickness = 0
@@ -220,6 +128,7 @@ include "combobox.rc"
 include "checkbox.rc"
 include "handles.rc"
 include "radiobutton.rc"
+include "entry.rc"
 
 class "GtkWidget"                                style "longomatch-default"
 class "GtkEntry"                                 style "longomatch-entry"
@@ -247,16 +156,15 @@ widget_class "*<GtkComboBox>.*"                  style "longomatch-combobox-chil
 widget_class "*TeamsComboBox*.*"                 style "longomatch-teams-combobox-children"
 
 class "GtkNotebook"                              style "longomatch-notebook"
-widget_class "*<GtkNotebook>*<GtkLabel>"                style "longomatch-notebook-tab-label"
+widget_class "*<GtkNotebook>*<GtkLabel>"         style "longomatch-notebook-tab-label"
+
+widget "*entryeventbox"                          style "longomatch-custom-entry"
+widget "*entryeventbox.*"                        style "longomatch-custom-entry-children"
 
 widget "*editorbuttonbar.*" style "longomatch-editor"
 widget "*dashboardeditorvbox.*.drawingarea" style "longomatch-drawingarea"
 widget "*roundedbutton*" style "longomatch-rounded-button"
 widget "*rectbutton*" style "longomatch-rect-button"
 widget "*headereventbox" style "longomatch-header"
-widget "*mediafilechooser*entry*" style "longomatch-filechooser-entry"
-widget "*datepicker*button*" style "longomatch-filechooser-button"
-widget "*datepicker*entry*" style "longomatch-filechooser-entry"
-widget "*mediafilechooser*button*" style "longomatch-filechooser-button"
 widget "*lightbackgroundeventbox*" style "longomatch-light-background"
 widget "*videoeventbox*" style "longomatch-default"


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