[gnome-control-center] info-overview: replace GtkTable with GtkGrid



commit 695887c7a0694a9b107e4cede59fa938bed76e10
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Wed Jun 7 11:49:32 2017 +0530

    info-overview: replace GtkTable with GtkGrid
    
    GtkTable has been deprecated. So let it be replaced with
    GtkGrid.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=779216

 panels/info/cc-info-overview-panel.c |   18 ++--
 panels/info/info-overview.ui         |  226 +++++++++++++++-------------------
 2 files changed, 109 insertions(+), 135 deletions(-)
---
diff --git a/panels/info/cc-info-overview-panel.c b/panels/info/cc-info-overview-panel.c
index 89c1ecd..be38d53 100644
--- a/panels/info/cc-info-overview-panel.c
+++ b/panels/info/cc-info-overview-panel.c
@@ -69,7 +69,7 @@ typedef struct
 
   /* Virtualisation labels */
   GtkWidget      *label8;
-  GtkWidget      *table1;
+  GtkWidget      *grid1;
   GtkWidget      *label18;
 
   char           *gnome_version;
@@ -667,20 +667,18 @@ get_cpu_info (const glibtop_sysinfo *info)
 }
 
 static void
-move_one_up (GtkWidget *table,
+move_one_up (GtkWidget *grid,
              GtkWidget *child)
 {
-  int top_attach, bottom_attach;
+  int top_attach;
 
-  gtk_container_child_get (GTK_CONTAINER (table),
+  gtk_container_child_get (GTK_CONTAINER (grid),
                            child,
                            "top-attach", &top_attach,
-                           "bottom-attach", &bottom_attach,
                            NULL);
-  gtk_container_child_set (GTK_CONTAINER (table),
+  gtk_container_child_set (GTK_CONTAINER (grid),
                            child,
                            "top-attach", top_attach - 1,
-                           "bottom-attach", bottom_attach - 1,
                            NULL);
 }
 
@@ -714,8 +712,8 @@ set_virtualization_label (CcInfoOverviewPanel *self,
   {
     gtk_widget_hide (priv->virt_type_label);
     gtk_widget_hide (priv->label18);
-    move_one_up (priv->table1, priv->label8);
-    move_one_up (priv->table1, priv->disk_label);
+    move_one_up (priv->grid1, priv->label8);
+    move_one_up (priv->grid1, priv->disk_label);
     return;
   }
 
@@ -918,7 +916,7 @@ cc_info_overview_panel_class_init (CcInfoOverviewPanelClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, virt_type_label);
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, updates_button);
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, label8);
-  gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, table1);
+  gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, grid1);
   gtk_widget_class_bind_template_child_private (widget_class, CcInfoOverviewPanel, label18);
 }
 
diff --git a/panels/info/info-overview.ui b/panels/info/info-overview.ui
index 7769980..2fdd232 100644
--- a/panels/info/info-overview.ui
+++ b/panels/info/info-overview.ui
@@ -35,13 +35,13 @@
       </packing>
     </child>
     <child>
-      <object class="GtkTable" id="table1">
+      <object class="GtkGrid" id="grid1">
         <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="n_rows">7</property>
-        <property name="n_columns">3</property>
-        <property name="column_spacing">12</property>
-        <property name="row_spacing">5</property>
+        <property name="halign">center</property>
+        <property name="valign">center</property>
+        <property name="can-focus">False</property>
+        <property name="column-spacing">12</property>
+        <property name="row-spacing">5</property>
         <child>
           <object class="GtkLabel" id="label4">
             <property name="visible">True</property>
@@ -53,6 +53,10 @@
              <class name="dim-label"/>
             </style>
           </object>
+          <packing>
+            <property name="top-attach">0</property>
+            <property name="left-attach">1</property>
+          </packing>
         </child>
         <child>
           <object class="GtkLabel" id="label5">
@@ -66,8 +70,8 @@
             </style>
           </object>
           <packing>
-            <property name="top_attach">1</property>
-            <property name="bottom_attach">2</property>
+            <property name="top-attach">1</property>
+            <property name="left-attach">1</property>
           </packing>
         </child>
         <child>
@@ -82,8 +86,23 @@
             </style>
           </object>
           <packing>
-            <property name="top_attach">2</property>
-            <property name="bottom_attach">3</property>
+            <property name="top-attach">2</property>
+            <property name="left-attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label14">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">1</property>
+            <property name="label" translatable="yes">Graphics</property>
+            <style>
+             <class name="dim-label"/>
+            </style>
+          </object>
+          <packing>
+            <property name="top-attach">3</property>
+            <property name="left-attach">1</property>
           </packing>
         </child>
         <child>
@@ -98,8 +117,8 @@
             </style>
           </object>
           <packing>
-            <property name="top_attach">4</property>
-            <property name="bottom_attach">5</property>
+            <property name="top-attach">4</property>
+            <property name="left-attach">1</property>
           </packing>
         </child>
         <child>
@@ -114,8 +133,24 @@
             </style>
           </object>
           <packing>
-            <property name="top_attach">5</property>
-            <property name="bottom_attach">6</property>
+            <property name="top-attach">5</property>
+            <property name="left-attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkLabel" id="label18">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="xalign">1</property>
+            <property name="label" translatable="yes">Virtualization</property>
+            <property name="mnemonic_widget">virt_type_label</property>
+            <style>
+             <class name="dim-label"/>
+            </style>
+          </object>
+          <packing>
+            <property name="top-attach">6</property>
+            <property name="left-attach">1</property>
           </packing>
         </child>
         <child>
@@ -130,8 +165,8 @@
             </style>
           </object>
           <packing>
-            <property name="top_attach">7</property>
-            <property name="bottom_attach">8</property>
+            <property name="top-attach">7</property>
+            <property name="left-attach">1</property>
           </packing>
         </child>
         <child>
@@ -140,8 +175,9 @@
             <property name="xalign">0</property>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
+            <property name="top-attach">0</property>
+            <property name="left-attach">2</property>
+            <property name="width">2</property>
           </packing>
         </child>
         <child>
@@ -153,10 +189,8 @@
             <property name="selectable">True</property>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">1</property>
-            <property name="bottom_attach">2</property>
+            <property name="top-attach">1</property>
+            <property name="left-attach">2</property>
           </packing>
         </child>
         <child>
@@ -168,14 +202,12 @@
             <property name="selectable">True</property>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">2</property>
-            <property name="bottom_attach">3</property>
+            <property name="top-attach">2</property>
+            <property name="left-attach">2</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="os_name_label">
+          <object class="GtkLabel" id="graphics_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">0</property>
@@ -183,14 +215,12 @@
             <property name="selectable">True</property>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">4</property>
-            <property name="bottom_attach">5</property>
+            <property name="top-attach">3</property>
+            <property name="left-attach">2</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="os_type_label">
+          <object class="GtkLabel" id="os_name_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">0</property>
@@ -198,173 +228,119 @@
             <property name="selectable">True</property>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">5</property>
-            <property name="bottom_attach">6</property>
+            <property name="top-attach">4</property>
+            <property name="left-attach">2</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="disk_label">
+          <object class="GtkLabel" id="os_type_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="xalign">0</property>
-            <property name="label" translatable="yes">Calculating…</property>
+            <property name="label">Unknown</property>
             <property name="selectable">True</property>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">7</property>
-            <property name="bottom_attach">8</property>
+            <property name="top-attach">5</property>
+            <property name="left-attach">2</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label9">
+          <object class="GtkLabel" id="virt_type_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="label">    </property>
+            <property name="xalign">0</property>
+            <property name="label">Unknown</property>
+            <property name="selectable">True</property>
           </object>
           <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
-            <property name="x_options">GTK_FILL</property>
+            <property name="top-attach">6</property>
+            <property name="left-attach">2</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label10">
+          <object class="GtkLabel" id="disk_label">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="label">    </property>
+            <property name="xalign">0</property>
+            <property name="label" translatable="yes">Calculating…</property>
+            <property name="selectable">True</property>
           </object>
           <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
-            <property name="top_attach">1</property>
-            <property name="bottom_attach">2</property>
-            <property name="x_options">GTK_FILL</property>
+            <property name="top-attach">7</property>
+            <property name="left-attach">2</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label11">
+          <object class="GtkLabel" id="label9">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="label">    </property>
           </object>
           <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
-            <property name="top_attach">2</property>
-            <property name="bottom_attach">3</property>
-            <property name="x_options">GTK_FILL</property>
+            <property name="top-attach">1</property>
+            <property name="left-attach">3</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label12">
+          <object class="GtkLabel" id="label10">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="label">    </property>
           </object>
           <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
-            <property name="top_attach">4</property>
-            <property name="bottom_attach">5</property>
-            <property name="x_options">GTK_FILL</property>
+            <property name="top-attach">2</property>
+            <property name="left-attach">3</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label13">
+          <object class="GtkLabel" id="label11">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="label">    </property>
           </object>
           <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
-            <property name="top_attach">6</property>
-            <property name="bottom_attach">7</property>
-            <property name="x_options">GTK_FILL</property>
+            <property name="top-attach">3</property>
+            <property name="left-attach">3</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label14">
+          <object class="GtkLabel" id="label12">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">Graphics</property>
-            <style>
-             <class name="dim-label"/>
-            </style>
+            <property name="label">    </property>
           </object>
           <packing>
-            <property name="top_attach">3</property>
-            <property name="bottom_attach">4</property>
+            <property name="top-attach">4</property>
+            <property name="left-attach">3</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="label15">
+          <object class="GtkLabel" id="label13">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <property name="label">    </property>
           </object>
           <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
-            <property name="top_attach">3</property>
-            <property name="bottom_attach">4</property>
-            <property name="x_options">GTK_FILL</property>
+            <property name="top-attach">5</property>
+            <property name="left-attach">3</property>
           </packing>
         </child>
         <child>
-          <object class="GtkLabel" id="graphics_label">
+          <object class="GtkLabel" id="label15">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label">Unknown</property>
-            <property name="selectable">True</property>
+            <property name="label">    </property>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">3</property>
-            <property name="bottom_attach">4</property>
+            <property name="top-attach">6</property>
+            <property name="left-attach">3</property>
           </packing>
         </child>
         <child>
           <placeholder/>
         </child>
-        <child>
-          <object class="GtkLabel" id="label18">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">1</property>
-            <property name="label" translatable="yes">Virtualization</property>
-            <property name="mnemonic_widget">virt_type_label</property>
-            <style>
-             <class name="dim-label"/>
-            </style>
-          </object>
-          <packing>
-            <property name="top_attach">5</property>
-            <property name="bottom_attach">6</property>
-          </packing>
-        </child>
-        <child>
-          <object class="GtkLabel" id="virt_type_label">
-            <property name="visible">True</property>
-            <property name="can_focus">False</property>
-            <property name="xalign">0</property>
-            <property name="label">Unknown</property>
-            <property name="selectable">True</property>
-          </object>
-          <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
-            <property name="top_attach">5</property>
-            <property name="bottom_attach">6</property>
-          </packing>
-        </child>
+        <!-- here -->
       </object>
       <packing>
         <property name="expand">False</property>


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