[meld] Clean up FindBar table and work around gtk.Table row spacing brokenness



commit 7afa4ea846d9bd632700dc4800dd6fe2cd8d7ff1
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Mon Mar 26 06:01:46 2012 +1000

    Clean up FindBar table and work around gtk.Table row spacing brokenness
    
    In a gtk.Table, row_spacing is displayed regardless of whether a row is
    visible or not. This was affecting FindBar when the Replace row was not
    shown. This commit cleans up the FindBar table somewhat and adds a hack
    to get rid of the undesired row spacing in Find mode.

 data/ui/findbar.ui |   35 +++++++++++------------------------
 meld/ui/findbar.py |    5 +++--
 2 files changed, 14 insertions(+), 26 deletions(-)
---
diff --git a/data/ui/findbar.ui b/data/ui/findbar.ui
index b474146..bf079e9 100644
--- a/data/ui/findbar.ui
+++ b/data/ui/findbar.ui
@@ -17,9 +17,8 @@
       <object class="GtkTable" id="findbar">
         <property name="can_focus">False</property>
         <property name="n_rows">2</property>
-        <property name="n_columns">6</property>
+        <property name="n_columns">5</property>
         <property name="column_spacing">6</property>
-        <property name="row_spacing">6</property>
         <child>
           <object class="GtkHButtonBox" id="hbuttonbox2">
             <property name="visible">True</property>
@@ -59,8 +58,8 @@
             </child>
           </object>
           <packing>
-            <property name="left_attach">3</property>
-            <property name="right_attach">5</property>
+            <property name="left_attach">2</property>
+            <property name="right_attach">4</property>
             <property name="top_attach">1</property>
             <property name="bottom_attach">2</property>
             <property name="x_options">GTK_FILL</property>
@@ -110,8 +109,8 @@
             </child>
           </object>
           <packing>
-            <property name="left_attach">3</property>
-            <property name="right_attach">5</property>
+            <property name="left_attach">2</property>
+            <property name="right_attach">4</property>
             <property name="x_options">GTK_FILL</property>
             <property name="y_options">GTK_FILL</property>
           </packing>
@@ -126,11 +125,8 @@
             <property name="mnemonic_widget">find_entry</property>
           </object>
           <packing>
-            <property name="left_attach">1</property>
-            <property name="right_attach">2</property>
             <property name="x_options">GTK_FILL</property>
             <property name="y_options">GTK_FILL</property>
-            <property name="x_padding">3</property>
           </packing>
         </child>
         <child>
@@ -140,8 +136,8 @@
             <property name="width_chars">32</property>
           </object>
           <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
+            <property name="left_attach">1</property>
+            <property name="right_attach">2</property>
             <property name="x_options">GTK_FILL</property>
             <property name="y_options">GTK_FILL</property>
           </packing>
@@ -156,13 +152,10 @@
             <property name="mnemonic_widget">replace_entry</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="x_options">GTK_FILL</property>
             <property name="y_options">GTK_FILL</property>
-            <property name="x_padding">3</property>
           </packing>
         </child>
         <child>
@@ -172,8 +165,8 @@
             <property name="width_chars">32</property>
           </object>
           <packing>
-            <property name="left_attach">2</property>
-            <property name="right_attach">3</property>
+            <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="x_options">GTK_FILL</property>
@@ -238,8 +231,8 @@
             </child>
           </object>
           <packing>
-            <property name="left_attach">5</property>
-            <property name="right_attach">6</property>
+            <property name="left_attach">4</property>
+            <property name="right_attach">5</property>
             <property name="x_options">GTK_FILL</property>
             <property name="y_options">GTK_FILL</property>
             <property name="x_padding">7</property>
@@ -248,12 +241,6 @@
         <child>
           <placeholder/>
         </child>
-        <child>
-          <placeholder/>
-        </child>
-        <child>
-          <placeholder/>
-        </child>
       </object>
     </child>
   </object>
diff --git a/meld/ui/findbar.py b/meld/ui/findbar.py
index 6eff9c8..fb6cd4b 100644
--- a/meld/ui/findbar.py
+++ b/meld/ui/findbar.py
@@ -47,10 +47,10 @@ class FindBar(gnomeglade.Component):
         self.textview = textview
         self.replace_label.hide()
         self.replace_entry.hide()
-        self.replace_button.hide()
-        self.replace_all_button.hide()
+        self.hbuttonbox2.hide()
         if text:
             self.find_entry.set_text(text)
+        self.widget.set_row_spacings(0)
         self.widget.show()
         self.find_entry.grab_focus()
 
@@ -72,6 +72,7 @@ class FindBar(gnomeglade.Component):
         self.textview = textview
         if text:
             self.find_entry.set_text(text)
+        self.widget.set_row_spacings(6)
         self.widget.show_all()
         self.find_entry.grab_focus()
 



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