[gnome-weather] city: overlay the side bar rather than pushing the content



commit 68050d45e706beaf21924befb3c8500f1e735807
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Sun Aug 18 18:06:19 2013 +0200

    city: overlay the side bar rather than pushing the content
    
    Pushing the content when opening the side bar has the odd effect
    that the window expands in the opposite direction (as the content
    cannot shrink anymore).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=695222

 data/city.ui |   83 +++++++++++++++++++++++++++++----------------------------
 src/city.js  |    2 +-
 2 files changed, 43 insertions(+), 42 deletions(-)
---
diff --git a/data/city.ui b/data/city.ui
index 412dfb6..8f53a64 100644
--- a/data/city.ui
+++ b/data/city.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
-  <object class="GtkBox" id="outer-box">
+  <object class="GtkOverlay" id="outer-box">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
@@ -91,53 +91,54 @@
                 <property name="height">1</property>
               </packing>
             </child>
+          </object>
+        </child>
+      </object>
+    </child>
+    <child type="overlay">
+      <object class="GtkGrid" id="revealer-grid">
+        <property name="visible">True</property>
+        <property name="halign">end</property>
+        <child>
+          <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>
+            <style>
+              <class name="image-button"/>
+              <class name="osd"/>
+            </style>
             <child>
-              <object class="GtkButton" id="reveal-button">
+              <object class="GtkImage" id="reveal-button-image">
                 <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>
-                <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>
+                <property name="can_focus">False</property>
+                <property name="icon-name">go-previous-symbolic</property>
+                <property name="icon-size">1</property>
               </object>
-              <packing>
-                <property name="left_attach">1</property>
-                <property name="top_attach">0</property>
-                <property name="width">1</property>
-                <property name="height">2</property>
-              </packing>
             </child>
           </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkRevealer" id="revealer">
+            <property name="reveal-child">false</property>
+            <property name="transition-type">slide-left</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">0</property>
+            <property name="width">1</property>
+            <property name="height">1</property>
+          </packing>
         </child>
       </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">0</property>
-      </packing>
-    </child>
-    <child>
-      <object class="GtkRevealer" id="revealer">
-        <property name="visible">True</property>
-        <property name="reveal-child">false</property>
-        <property name="transition-type">slide-left</property>
-      </object>
-      <packing>
-        <property name="expand">False</property>
-        <property name="fill">True</property>
-        <property name="position">1</property>
-      </packing>
     </child>
   </object>
 </interface>
diff --git a/src/city.js b/src/city.js
index 6804a00..3c286c0 100644
--- a/src/city.js
+++ b/src/city.js
@@ -45,7 +45,7 @@ const WeatherWidget = new Lang.Class({
         this._revealer = builder.get_object('revealer');
 
         this._forecasts = new Forecast.ForecastBox({ hexpand: true });
-        outerGrid.attach(this._forecasts, 0, 1, 2, 1);
+        outerGrid.attach(this._forecasts, 0, 1, 1, 1);
 
         this._today = new Forecast.TodaySidebar({ vexpand: true,
                                                   name: 'today-sidebar' });


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