[Sugar-devel] [PATCH shell 3/3] Fix layout of Clear search button in Journal and Activity List - SL #3809

Manuel Quiñones manuq at laptop.org
Mon Sep 24 22:31:14 EDT 2012


To do it, add the button to a ButtonBox with layout
Gtk.ButtonBoxStyle.CENTER.

Signed-off-by: Manuel Quiñones <manuq at laptop.org>
---
 src/jarabe/desktop/activitieslist.py | 7 ++++++-
 src/jarabe/journal/listview.py       | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/jarabe/desktop/activitieslist.py b/src/jarabe/desktop/activitieslist.py
index b111164..b830526 100644
--- a/src/jarabe/desktop/activitieslist.py
+++ b/src/jarabe/desktop/activitieslist.py
@@ -333,11 +333,16 @@ class ClearMessageBox(Gtk.EventBox):
         box.pack_start(label, expand=True, fill=False, padding=0)
         label.show()
 
+        button_box = Gtk.HButtonBox()
+        button_box.set_layout(Gtk.ButtonBoxStyle.CENTER)
+        box.pack_start(button_box, False, True, 0)
+        button_box.show()
+
         button = Gtk.Button(label=_('Clear search'))
         button.connect('clicked', button_callback)
         button.props.image = Icon(icon_name='dialog-cancel',
                                   icon_size=Gtk.IconSize.BUTTON)
-        box.pack_start(button, expand=True, fill=False, padding=0)
+        button_box.pack_start(button, expand=True, fill=False, padding=0)
         button.show()
 
 
diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
index 46c3440..917beb0 100644
--- a/src/jarabe/journal/listview.py
+++ b/src/jarabe/journal/listview.py
@@ -403,11 +403,16 @@ class BaseListView(Gtk.Bin):
         box.pack_start(label, expand=True, fill=False, padding=0)
 
         if show_clear_query:
+            button_box = Gtk.HButtonBox()
+            button_box.set_layout(Gtk.ButtonBoxStyle.CENTER)
+            box.pack_start(button_box, False, True, 0)
+            button_box.show()
+
             button = Gtk.Button(label=_('Clear search'))
             button.connect('clicked', self.__clear_button_clicked_cb)
             button.props.image = Icon(icon_name='dialog-cancel',
                                       icon_size=Gtk.IconSize.BUTTON)
-            box.pack_start(button, expand=True, fill=False, padding=0)
+            button_box.pack_start(button, expand=True, fill=False, padding=0)
 
         background_box.show_all()
 
-- 
1.7.11.4



More information about the Sugar-devel mailing list