[gnome-weather] Replace GdHeaderButtons with regular Gtk buttons



commit 2bfa336132d1e6a1d8f539305ec74b4546b62a41
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Jun 2 15:55:49 2013 +0200

    Replace GdHeaderButtons with regular Gtk buttons
    
    One step closer to editing the window.ui files in glade (just
    need to wait until glade learns about the new Gtk widgets)

 data/city.ui   |   12 ++++++-
 data/window.ui |   90 +++++++++++++++++++++++++++++++++++++++++++++++++-------
 src/city.js    |    4 +-
 3 files changed, 91 insertions(+), 15 deletions(-)
---
diff --git a/data/city.ui b/data/city.ui
index d1442ca..412dfb6 100644
--- a/data/city.ui
+++ b/data/city.ui
@@ -92,16 +92,24 @@
               </packing>
             </child>
             <child>
-              <object class="GdHeaderSimpleButton" id="reveal-button">
+              <object class="GtkButton" id="reveal-button">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="halign">center</property>
                 <property name="valign">center</property>
                 <property name="margin_right">20</property>
-                <property name="symbolic_icon_name">go-previous-symbolic</property>
                 <style>
+                  <class name="image-button"/>
                   <class name="osd"/>
                 </style>
+                <child>
+                  <object class="GtkImage" id="reveal-button-image">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="icon-name">go-previous-symbolic</property>
+                    <property name="icon-size">1</property>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="left_attach">1</property>
diff --git a/data/window.ui b/data/window.ui
index 5dc3152..dd3e683 100644
--- a/data/window.ui
+++ b/data/window.ui
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <!-- interface-requires gtk+ 3.8 -->
+  <!-- interface-requires gtk+ 3.10 -->
   <menu id="selection-menu">
     <section>
       <item>
@@ -14,9 +14,41 @@
       </item>
     </section>
   </menu>
-  <object class="GdHeaderMenuButton" id="selection-menu-button">
-    <property name="label" translatable="yes">Click on items to select them</property>
+  <object class="GtkMenuButton" id="selection-menu-button">
     <property name="menu-model">selection-menu</property>
+    <property name="visible">True</property>
+    <property name="can-focus">True</property>
+    <child>
+      <object class="GtkBox" id="selection-menu-button-box">
+        <property name="visible">True</property>
+        <property name="can-focus">False</property>
+        <property name="orientation">horizontal</property>
+        <property name="spacing">6</property>
+        <child>
+          <object class="GtkLabel" id="selection-menu-button-label">
+            <property name="visible">True</property>
+            <property name="can-focus">False</property>
+            <property name="label" translatable="yes">Click on locations to select them</property>
+          </object>
+          <packing>
+            <property name="pack-type">start</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkArrow" id="selection-menu-button-arrow">
+            <property name="visible">True</property>
+            <property name="can-focus">False</property>
+            <property name="arrow-type">down</property>
+            <property name="shadow-type">none</property>
+          </object>
+          <packing>
+            <property name="pack-type">start</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
     <style>
       <class name="selection-menu"/>
     </style>
@@ -30,47 +62,68 @@
         <property name="visible">True</property>
         <property name="vexpand">False</property>
         <child>
-          <object class="GdHeaderSimpleButton" id="new-button">
+          <object class="GtkButton" id="new-button">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="label" translatable="yes">New</property>
             <property name="action-name">win.new-location</property>
+            <property name="valign">center</property>
+            <style>
+              <class name="text-button"/>
+            </style>
           </object>
           <packing>
             <property name="pack_type">start</property>
           </packing>
         </child>
         <child>
-          <object class="GdHeaderSimpleButton" id="world-button">
+          <object class="GtkButton" id="world-button">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="label" translatable="yes">World Weather</property>
+            <property name="valign">center</property>
+            <style>
+              <class name="text-button"/>
+            </style>
           </object>
           <packing>
             <property name="pack_type">start</property>
           </packing>
         </child>
         <child>
-          <object class="GdHeaderSimpleButton" id="select-button">
+          <object class="GtkButton" id="select-button">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="symbolic-icon-name">object-select-symbolic</property>
             <property name="action-name">win.selection-mode</property>
             <property name="action-target">true</property>
+            <property name="valign">center</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="select-button-image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon-name">object-select-symbolic</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="pack_type">end</property>
           </packing>
         </child>
         <child>
-          <object class="GdHeaderSimpleButton" id="done-button">
+          <object class="GtkButton" id="done-button">
             <property name="visible">True</property>
             <property name="no_show_all">True</property>
             <property name="can_focus">True</property>
             <property name="label" translatable="yes">Cancel</property>
+            <property name="valign">center</property>
             <property name="action-name">win.selection-mode</property>
             <property name="action-target">false</property>
             <style>
+              <class name="text-button"/>
               <class name="suggested-action"/>
             </style>
           </object>
@@ -79,11 +132,22 @@
           </packing>
         </child>
         <child>
-          <object class="GdHeaderSimpleButton" id="refresh-button">
+          <object class="GtkButton" id="refresh-button">
             <property name="visible">True</property>
             <property name="can_focus">True</property>
-            <property name="symbolic-icon-name">view-refresh-symbolic</property>
             <property name="action-name">win.refresh</property>
+            <property name="valign">center</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="refresh-button-image">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="icon-name">view-refresh-symbolic</property>
+                <property name="icon-size">1</property>
+              </object>
+            </child>
           </object>
           <packing>
             <property name="pack_type">end</property>
@@ -123,11 +187,15 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child>
-              <object class="GdHeaderSimpleButton" id="delete-button">
+              <object class="GtkButton" id="delete-button">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="label" translatable="yes">Delete</property>
                 <property name="action-name">win.delete-selected</property>
+                <property name="valign">center</property>
+                <style>
+                  <class name="text-button"/>
+                </style>
               </object>
               <packing>
                 <property name="pack_type">start</property>
diff --git a/src/city.js b/src/city.js
index 2a310f1..8369acd 100644
--- a/src/city.js
+++ b/src/city.js
@@ -54,10 +54,10 @@ const WeatherWidget = new Lang.Class({
         this._revealButton.connect('clicked', Lang.bind(this, function() {
             if (this._revealer.reveal_child) {
                 this._revealer.reveal_child = false;
-                this._revealButton.symbolic_icon_name = 'go-previous-symbolic';
+                this._revealButton.get_child().icon_name = 'go-previous-symbolic';
             } else {
                 this._revealer.reveal_child = true;
-                this._revealButton.symbolic_icon_name = 'go-next-symbolic';
+                this._revealButton.get_child().icon_name = 'go-next-symbolic';
             }
         }));
 


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