From d5eacc73aa7a9e8949d38620714d5219e627d523 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
Date: Mon, 24 Sep 2012 23:27:41 -0300
Subject: [PATCH shell 3/3] Fix layout of Clear search button in Journal and
Activity List - SL #3809
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
To do it, add the button to a ButtonBox with layout
Gtk.ButtonBoxStyle.CENTER.
Signed-off-by: Manuel Quiñones <manuq@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
|
b
|
class ClearMessageBox(Gtk.EventBox): |
333 | 333 | box.pack_start(label, expand=True, fill=False, padding=0) |
334 | 334 | label.show() |
335 | 335 | |
| 336 | button_box = Gtk.HButtonBox() |
| 337 | button_box.set_layout(Gtk.ButtonBoxStyle.CENTER) |
| 338 | box.pack_start(button_box, False, True, 0) |
| 339 | button_box.show() |
| 340 | |
336 | 341 | button = Gtk.Button(label=_('Clear search')) |
337 | 342 | button.connect('clicked', button_callback) |
338 | 343 | button.props.image = Icon(icon_name='dialog-cancel', |
339 | 344 | icon_size=Gtk.IconSize.BUTTON) |
340 | | box.pack_start(button, expand=True, fill=False, padding=0) |
| 345 | button_box.pack_start(button, expand=True, fill=False, padding=0) |
341 | 346 | button.show() |
342 | 347 | |
343 | 348 | |
diff --git a/src/jarabe/journal/listview.py b/src/jarabe/journal/listview.py
index 46c3440..917beb0 100644
a
|
b
|
class BaseListView(Gtk.Bin): |
403 | 403 | box.pack_start(label, expand=True, fill=False, padding=0) |
404 | 404 | |
405 | 405 | if show_clear_query: |
| 406 | button_box = Gtk.HButtonBox() |
| 407 | button_box.set_layout(Gtk.ButtonBoxStyle.CENTER) |
| 408 | box.pack_start(button_box, False, True, 0) |
| 409 | button_box.show() |
| 410 | |
406 | 411 | button = Gtk.Button(label=_('Clear search')) |
407 | 412 | button.connect('clicked', self.__clear_button_clicked_cb) |
408 | 413 | button.props.image = Icon(icon_name='dialog-cancel', |
409 | 414 | icon_size=Gtk.IconSize.BUTTON) |
410 | | box.pack_start(button, expand=True, fill=False, padding=0) |
| 415 | button_box.pack_start(button, expand=True, fill=False, padding=0) |
411 | 416 | |
412 | 417 | background_box.show_all() |
413 | 418 | |