[meld] filediff: Convert from GtkTable to GtkGrid



commit f76283d0b7c08bc81d747a6bc2dac3ba4f5aa120
Author: Peter Tyser <ptyser gmail com>
Date:   Sat Dec 14 14:33:23 2013 -0600

    filediff: Convert from GtkTable to GtkGrid
    
    Signed-off-by: Peter Tyser <ptyser gmail com>

 data/ui/filediff.ui |   66 ++++++++++++++++++--------------------------------
 meld/filediff.py    |    9 +++----
 2 files changed, 28 insertions(+), 47 deletions(-)
---
diff --git a/data/ui/filediff.ui b/data/ui/filediff.ui
index e6affe7..c5b7aee 100644
--- a/data/ui/filediff.ui
+++ b/data/ui/filediff.ui
@@ -110,11 +110,9 @@
         <property name="can_focus">False</property>
         <signal name="key-press-event" handler="on_key_press_event" swapped="no"/>
         <child>
-          <object class="GtkTable" id="table">
+          <object class="GtkGrid" id="grid">
             <property name="visible">True</property>
             <property name="can_focus">False</property>
-            <property name="n_rows">3</property>
-            <property name="n_columns">7</property>
             <child>
               <placeholder/>
             </child>
@@ -176,9 +174,8 @@
               </object>
               <packing>
                 <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options"/>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -221,9 +218,8 @@
               </object>
               <packing>
                 <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options"/>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -266,9 +262,8 @@
               </object>
               <packing>
                 <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
-                <property name="x_options">GTK_EXPAND | GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options"/>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -317,9 +312,7 @@
               </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>
               </packing>
             </child>
             <child>
@@ -332,9 +325,8 @@
               </object>
               <packing>
                 <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
-                <property name="x_options">GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_SHRINK | GTK_FILL</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -346,9 +338,8 @@
               </object>
               <packing>
                 <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="x_options">GTK_SHRINK | GTK_FILL</property>
-                <property name="y_options">GTK_SHRINK | GTK_FILL</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -359,8 +350,8 @@
                 <property name="stock">gtk-missing-image</property>
               </object>
               <packing>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -407,9 +398,7 @@
               </object>
               <packing>
                 <property name="left_attach">5</property>
-                <property name="right_attach">6</property>
                 <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
               </packing>
             </child>
             <child>
@@ -456,9 +445,7 @@
               </object>
               <packing>
                 <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
                 <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
               </packing>
             </child>
             <child>
@@ -468,10 +455,9 @@
               </object>
               <packing>
                 <property name="left_attach">6</property>
-                <property name="right_attach">7</property>
                 <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options"/>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -492,9 +478,8 @@
               </object>
               <packing>
                 <property name="left_attach">6</property>
-                <property name="right_attach">7</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -506,11 +491,9 @@
               </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="y_options">GTK_FILL</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -519,9 +502,10 @@
                 <property name="can_focus">False</property>
               </object>
               <packing>
+                <property name="left_attach">0</property>
                 <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options"/>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
             <child>
@@ -533,11 +517,9 @@
               </object>
               <packing>
                 <property name="left_attach">4</property>
-                <property name="right_attach">5</property>
                 <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options">GTK_FILL</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
               </packing>
             </child>
           </object>
diff --git a/meld/filediff.py b/meld/filediff.py
index b4e9bd5..2e1b048 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -309,7 +309,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         self.actiongroup.add_toggle_actions(toggle_actions)
         self.main_actiongroup = None
 
-        self.findbar = findbar.FindBar(self.table)
+        self.findbar = findbar.FindBar(self.grid)
 
         self.widget.ensure_style()
         self.on_style_set(self.widget, None)
@@ -1870,10 +1870,9 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
                 widget.hide()
 
             right_attach = 2 * n
-            if self.findbar.widget in self.table:
-                self.table.remove(self.findbar.widget)
-            self.table.attach(self.findbar.widget, 1, right_attach, 2, 3,
-                              Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL)
+            if self.findbar.widget in self.grid:
+                self.grid.remove(self.findbar.widget)
+            self.grid.attach(self.findbar.widget, 1, 2, right_attach - 1, 1)
 
             self.actiongroup.get_action("MakePatch").set_sensitive(n > 1)
             self.actiongroup.get_action("CycleDocuments").set_sensitive(n > 1)


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