[gnome-control-center] wacom: split the main page controls in a separate GtkGrid



commit 41e55372a942e22e2d06aa318a95a91e0549eaf3
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Feb 16 00:36:17 2012 -0500

    wacom: split the main page controls in a separate GtkGrid
    
    The effect we want to achieve is to have the model name and button box
    padded 16px to the left of the tablet controls below.
    Pack all the tablet controls in a separate GtkGrid, so we can just set a
    margin on that and offset its contents from the model above.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=668881

 panels/wacom/cc-wacom-page.c           |    6 +-
 panels/wacom/gnome-wacom-properties.ui |  232 +++++++++++++++++---------------
 2 files changed, 127 insertions(+), 111 deletions(-)
---
diff --git a/panels/wacom/cc-wacom-page.c b/panels/wacom/cc-wacom-page.c
index 6787733..0800a98 100644
--- a/panels/wacom/cc-wacom-page.c
+++ b/panels/wacom/cc-wacom-page.c
@@ -848,6 +848,10 @@ static void
 remove_display_link (CcWacomPagePrivate *priv)
 {
 	gtk_widget_destroy (WID ("display-link"));
+
+        gtk_container_child_set (CWID ("main-grid"),
+                                 WID ("main-controls-grid"),
+                                 "top_attach", 2, NULL);
 }
 
 static void
@@ -880,11 +884,9 @@ update_tablet_ui (CcWacomPage *page,
 
 		gtk_container_child_set (CWID ("main-grid"),
 					 WID ("tablet-buttons-box"),
-					 "left_attach", 1,
 					 "top_attach", 1, NULL);
 		gtk_container_child_set (CWID ("main-grid"),
 					 WID ("display-link"),
-					 "left_attach", 1,
 					 "top_attach", 2, NULL);
 		break;
 	default:
diff --git a/panels/wacom/gnome-wacom-properties.ui b/panels/wacom/gnome-wacom-properties.ui
index a2f8466..03a2f58 100644
--- a/panels/wacom/gnome-wacom-properties.ui
+++ b/panels/wacom/gnome-wacom-properties.ui
@@ -165,89 +165,6 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <child>
-                  <object class="GtkImage" id="image-tablet">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="pixbuf">wacom-tablet.svg</property>
-                    <property name="margin-right">16</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">1</property>
-                    <property name="width">1</property>
-                    <property name="height">4</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="combo-tabletmode">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="valign">center</property>
-                    <property name="hexpand">True</property>
-                    <property name="model">liststore-tabletmode</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label-trackingmode">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">end</property>
-                    <property name="valign">center</property>
-                    <property name="margin_right">10</property>
-                    <property name="label" translatable="yes">Tracking Mode</property>
-                    <property name="justify">right</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">1</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label-left-handed">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">end</property>
-                    <property name="valign">center</property>                    
-                    <property name="margin_right">10</property>
-                    <property name="label" translatable="yes">Left-Handed Orientation</property>
-                    <style>
-                      <class name="dim-label"/>
-                    </style>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">3</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkSwitch" id="switch-left-handed">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="halign">start</property>
-                    <property name="valign">center</property>
-                    <property name="use_action_appearance">False</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">2</property>
-                    <property name="top_attach">3</property>
-                    <property name="width">1</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
                   <object class="GtkLabel" id="label-tabletmodel">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -264,40 +181,22 @@
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="top_attach">0</property>
-                    <property name="width">2</property>
+                    <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkNotebook" id="stylus-notebook">
+                  <object class="GtkImage" id="image-tablet">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="vexpand">True</property>
-                    <property name="show_tabs">False</property>
+                    <property name="can_focus">False</property>
+                    <property name="pixbuf">wacom-tablet.svg</property>
+                    <property name="margin-right">16</property>
                   </object>
                   <packing>
                     <property name="left_attach">0</property>
-                    <property name="top_attach">5</property>
-                    <property name="width">3</property>
-                    <property name="height">1</property>
-                  </packing>
-                </child>
-                <child>
-                 <object class="GtkLinkButton" id="display-link">
-                   <property name="label" translatable="yes">Adjust display resolution</property>
-                   <property name="visible">False</property>
-                   <property name="can_focus">True</property>
-                   <property name="receives_default">True</property>
-                   <property name="has_tooltip">True</property>
-                   <property name="use_action_appearance">False</property>
-                   <property name="relief">none</property>
-                   <property name="halign">start</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">1</property>
-                    <property name="top_attach">4</property>
+                    <property name="top_attach">1</property>
                     <property name="width">1</property>
-                    <property name="height">1</property>
+                    <property name="height">3</property>
                   </packing>
                 </child>
                 <child>
@@ -359,12 +258,127 @@
                     </child>
                   </object>
                   <packing>
-                    <property name="left_attach">2</property>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">1</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                 <object class="GtkLinkButton" id="display-link">
+                   <property name="label" translatable="yes">Adjust display resolution</property>
+                   <property name="visible">False</property>
+                   <property name="can_focus">True</property>
+                   <property name="receives_default">True</property>
+                   <property name="has_tooltip">True</property>
+                   <property name="use_action_appearance">False</property>
+                   <property name="relief">none</property>
+                   <property name="halign">start</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
                     <property name="top_attach">2</property>
                     <property name="width">1</property>
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkGrid" id="main-controls-grid">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <property name="margin_left">16</property>
+                    <child>
+                      <object class="GtkLabel" id="label-trackingmode">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">end</property>
+                        <property name="valign">center</property>
+                        <property name="margin_right">10</property>
+                        <property name="label" translatable="yes">Tracking Mode</property>
+                        <property name="justify">right</property>
+                        <style>
+                          <class name="dim-label"/>
+                        </style>
+                      </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="GtkComboBox" id="combo-tabletmode">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="valign">center</property>
+                        <property name="hexpand">True</property>
+                        <property name="model">liststore-tabletmode</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>
+                    <child>
+                      <object class="GtkLabel" id="label-left-handed">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="halign">end</property>
+                        <property name="valign">center</property>                    
+                        <property name="margin_right">10</property>
+                        <property name="label" translatable="yes">Left-Handed Orientation</property>
+                        <style>
+                          <class name="dim-label"/>
+                        </style>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkSwitch" id="switch-left-handed">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="halign">start</property>
+                        <property name="valign">center</property>
+                        <property name="use_action_appearance">False</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">1</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">3</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkNotebook" id="stylus-notebook">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="show_tabs">False</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">0</property>
+                    <property name="top_attach">4</property>
+                    <property name="width">2</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="position">1</property>



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