[meld] Move FindBar positioning to main table rather than external vbox
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] Move FindBar positioning to main table rather than external vbox
- Date: Sat, 28 Apr 2012 23:21:09 +0000 (UTC)
commit 47b3e8d0d3d4b12053c11f7664f18f5d2b9a29ca
Author: Kai Willadsen <kai willadsen gmail com>
Date: Mon Mar 26 05:32:56 2012 +1000
Move FindBar positioning to main table rather than external vbox
Packing in the main table loses us some small amount of flexibility,
but it's the easiest way to get spacing correct, e.g., lining up with
the left edge of the first textview.
data/ui/filediff.ui | 2 +-
meld/filediff.py | 9 +++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/data/ui/filediff.ui b/data/ui/filediff.ui
index 9619c4a..1f5027b 100644
--- a/data/ui/filediff.ui
+++ b/data/ui/filediff.ui
@@ -11,7 +11,7 @@
<child>
<object class="GtkTable" id="table">
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">7</property>
<child>
<placeholder/>
diff --git a/meld/filediff.py b/meld/filediff.py
index a0f4f26..de879a3 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -322,11 +322,10 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
self.actiongroup.set_translation_domain("meld")
self.actiongroup.add_actions(actions)
self.actiongroup.add_toggle_actions(toggle_actions)
+ self.findbar = findbar.FindBar(self.table)
self.set_num_panes(num_panes)
gobject.idle_add( lambda *args: self.load_font()) # hack around Bug 316730
gnomeglade.connect_signal_handlers(self)
- self.findbar = findbar.FindBar(self.filediff)
- self.filediff.pack_end(self.findbar.widget, False)
self.cursor = CursorDetails()
self.connect("current-diff-changed", self.on_current_diff_changed)
for t in self.textview:
@@ -1586,6 +1585,12 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
tohide += self.linkmap[n-1:] + self.diffmap[n:]
map( lambda x: x.hide(), tohide )
+ 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.FILL, gtk.FILL)
+
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]