Merge lp:~mvo/software-center/lp1034894-again into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3182
Proposed branch: lp:~mvo/software-center/lp1034894-again
Merge into: lp:software-center
Diff against target: 62 lines (+14/-10)
3 files modified
softwarecenter/ui/gtk3/widgets/backforward.py (+3/-8)
tests/gtk3/test_widgets.py (+9/-0)
tests/gtk3/windows.py (+2/-2)
To merge this branch: bzr merge lp:~mvo/software-center/lp1034894-again
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+124706@code.launchpad.net

Description of the change

This branch fixes bug #1034894 by putting the Gtk.STYLE_CLASS_LINKED
info on the right widget

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Michael, this looks good, thanks for fixing this fix.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/widgets/backforward.py'
2--- softwarecenter/ui/gtk3/widgets/backforward.py 2012-08-29 20:45:07 +0000
3+++ softwarecenter/ui/gtk3/widgets/backforward.py 2012-09-17 14:53:43 +0000
4@@ -38,6 +38,9 @@
5 def __init__(self, part_size=None):
6 Gtk.HBox.__init__(self)
7
8+ context = self.get_style_context()
9+ context.add_class(Gtk.STYLE_CLASS_LINKED)
10+
11 atk_obj = self.get_accessible()
12 atk_obj.set_name(_('History Navigation'))
13 atk_obj.set_description(_('Navigate forwards and backwards.'))
14@@ -59,14 +62,6 @@
15 self.right = ButtonPart('right-clicked',
16 arrow_type=Gtk.ArrowType.RIGHT)
17
18- context = self.left.get_style_context()
19- context.add_class("backforward-left-button")
20- context.add_class(Gtk.STYLE_CLASS_LINKED)
21-
22- context = self.right.get_style_context()
23- context.add_class("backforward-right-button")
24- context.add_class(Gtk.STYLE_CLASS_LINKED)
25-
26 self.set_button_atk_info_ltr()
27 else:
28 # rtl
29
30=== modified file 'tests/gtk3/test_widgets.py'
31--- tests/gtk3/test_widgets.py 2012-08-20 09:09:45 +0000
32+++ tests/gtk3/test_widgets.py 2012-09-17 14:53:43 +0000
33@@ -59,6 +59,15 @@
34 win = get_test_backforward_window()
35 self.addCleanup(win.destroy)
36
37+ def test_backforward_lp1034894(self):
38+ win = get_test_backforward_window(width=150, height=75)
39+ backforward = win.get_children()[0]
40+ style_context = backforward.get_style_context()
41+ self.assertTrue(style_context.has_class(Gtk.STYLE_CLASS_LINKED))
42+ self.addCleanup(win.destroy)
43+ GObject.timeout_add(TIMEOUT, Gtk.main_quit)
44+ Gtk.main()
45+
46 def test_containers(self):
47 win = get_test_container_window()
48 self.addCleanup(win.destroy)
49
50=== modified file 'tests/gtk3/windows.py'
51--- tests/gtk3/windows.py 2012-09-05 20:53:30 +0000
52+++ tests/gtk3/windows.py 2012-09-17 14:53:43 +0000
53@@ -563,9 +563,9 @@
54 return win
55
56
57-def get_test_backforward_window():
58+def get_test_backforward_window(*args, **kwargs):
59 backforward_button = backforward.BackForwardButton()
60- win = get_test_window(child=backforward_button)
61+ win = get_test_window(child=backforward_button, *args, **kwargs)
62 return win
63
64

Subscribers

People subscribed via source and target branches