Merge lp:~mmcg069/software-center/misbehaving-pathbar-fix into lp:software-center

Proposed by Matthew McGowan
Status: Merged
Approved by: Gary Lasker
Approved revision: 1083
Merge reported by: Gary Lasker
Merged at revision: not available
Proposed branch: lp:~mmcg069/software-center/misbehaving-pathbar-fix
Merge into: lp:software-center
Diff against target: 118 lines (+43/-14) (has conflicts)
2 files modified
data/ui/SoftwareCenter.ui (+23/-13)
softwarecenter/app.py (+20/-1)
Text conflict in data/ui/SoftwareCenter.ui
To merge this branch: bzr merge lp:~mmcg069/software-center/misbehaving-pathbar-fix
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+34140@code.launchpad.net

Description of the change

Fixes bug #625210. Pathbutton no longer shrinks to available width.

This issue is resolved by removing the Viewport which parented the main Notebook widget. The Viewport was only used to paint the border around the Notebook so this is harmless.

The border width of the Notebook is now set to 1px and the borders a painted in an expose-event handler connected to the Notebook.

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

Looks good, Matthew McGowan! I've merged it. Thanks a lot as always. :)

With aggressive resizing, I do notice some minor artifacts showing for the redrawn pathbutton. Do you see that? They seem quite minor so we can decide if we want to take a look at that.

This does indeed fix bug #625210 (and bug #625210).

Thanks again!

review: Approve
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Of course, the second bug listed above should be bug #620514. ;)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/ui/SoftwareCenter.ui'
2--- data/ui/SoftwareCenter.ui 2010-08-30 09:40:20 +0000
3+++ data/ui/SoftwareCenter.ui 2010-08-30 23:36:49 +0000
4@@ -60,7 +60,11 @@
5 <child>
6 <object class="GtkMenuItem" id="menuitem_reinstall_purchases">
7 <property name="visible">True</property>
8+<<<<<<< TREE
9 <property name="label" translatable="yes">Reinstall Previous Purchases…</property>
10+=======
11+ <property name="label" translatable="yes">Reinstall Previous Purchases&#x2026;</property>
12+>>>>>>> MERGE-SOURCE
13 <property name="use_underline">True</property>
14 <signal name="activate" handler="on_menuitem_reinstall_purchases_activate"/>
15 </object>
16@@ -188,7 +192,11 @@
17 </child>
18 <child>
19 <object class="GtkImageMenuItem" id="menuitem_search">
20+<<<<<<< TREE
21 <property name="label" translatable="yes">Search…</property>
22+=======
23+ <property name="label" translatable="yes">Search&#x2026;</property>
24+>>>>>>> MERGE-SOURCE
25 <property name="visible">True</property>
26 <property name="use_underline">True</property>
27 <property name="image">image2</property>
28@@ -204,7 +212,11 @@
29 </child>
30 <child>
31 <object class="GtkImageMenuItem" id="menuitem_software_sources">
32+<<<<<<< TREE
33 <property name="label" translatable="yes">_Software Sources…</property>
34+=======
35+ <property name="label" translatable="yes">_Software Sources&#x2026;</property>
36+>>>>>>> MERGE-SOURCE
37 <property name="visible">True</property>
38 <property name="use_underline">True</property>
39 <property name="image">image4</property>
40@@ -341,21 +353,15 @@
41 </packing>
42 </child>
43 <child>
44- <object class="GtkViewport" id="viewport1">
45+ <object class="GtkNotebook" id="notebook_view">
46 <property name="visible">True</property>
47- <property name="resize_mode">queue</property>
48+ <property name="show_tabs">False</property>
49+ <property name="show_border">False</property>
50 <child>
51- <object class="GtkNotebook" id="notebook_view">
52- <property name="visible">True</property>
53- <property name="show_tabs">False</property>
54- <property name="show_border">False</property>
55- <child>
56- <placeholder/>
57- </child>
58- <child type="tab">
59- <placeholder/>
60- </child>
61- </object>
62+ <placeholder/>
63+ </child>
64+ <child type="tab">
65+ <placeholder/>
66 </child>
67 </object>
68 <packing>
69@@ -455,7 +461,11 @@
70 <child>
71 <object class="GtkLabel" id="label_rebuilding">
72 <property name="visible">True</property>
73+<<<<<<< TREE
74 <property name="label" translatable="yes">Rebuilding software catalog…</property>
75+=======
76+ <property name="label" translatable="yes">Rebuilding software catalog&#x2026;</property>
77+>>>>>>> MERGE-SOURCE
78 <attributes>
79 <attribute name="weight" value="bold"/>
80 </attributes>
81
82=== modified file 'softwarecenter/app.py'
83--- softwarecenter/app.py 2010-08-28 11:16:59 +0000
84+++ softwarecenter/app.py 2010-08-30 23:36:49 +0000
85@@ -189,6 +189,10 @@
86 self._block_menuitem_view = False
87 self._available_items_for_page = {}
88
89+ # hackery, paint viewport borders around notebook
90+ self.notebook_view.set_border_width(1)
91+ self.notebook_view.connect('expose-event', self._on_notebook_expose)
92+
93 # register view manager and create view panes/widgets
94 self.view_manager = ViewManager(self.notebook_view)
95
96@@ -723,7 +727,22 @@
97 return
98 if view.dialogs.confirm_repair_broken_cache(self.window_main, self.datadir):
99 self.backend.fix_broken_depends()
100-
101+
102+ def _on_notebook_expose(self, widget, event):
103+ # use availabel pane as the Style source so viewport colours are the same
104+ # as a real Viewport
105+ self.available_pane.style.paint_shadow(widget.window,
106+ gtk.STATE_NORMAL,
107+ gtk.SHADOW_IN,
108+ event.area,
109+ widget,
110+ 'viewport',
111+ widget.allocation.x,
112+ widget.allocation.y,
113+ widget.allocation.width,
114+ widget.allocation.height)
115+ return
116+
117 def _on_apt_cache_broken(self, aptcache):
118 self._ask_and_repair_broken_cache()
119