Merge lp:~evfool/software-center/smallfixes into lp:software-center

Proposed by Robert Roth
Status: Merged
Merged at revision: 1868
Proposed branch: lp:~evfool/software-center/smallfixes
Merge into: lp:software-center
Diff against target: 27 lines (+4/-3)
1 file modified
softwarecenter/ui/gtk/widgets/mkit.py (+4/-3)
To merge this branch: bzr merge lp:~evfool/software-center/smallfixes
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+65456@code.launchpad.net

Description of the change

Small fixes to the LinkButton from mkit to behave more like other widgets/links
1) When pressing mouse button over a Linkbutton, dragging out and then back in, the link color turn from normal to active (when pressing the button) and from active to normal (when leaving the link's area) and then back from normal to active (when reentering with the mouse button still pressed) - before this fix it did not, thus when dragging out and in while the button is pressed, the link color did not change back to active, in spite of the fact that the mouse was still over the link, the button was still pressed, and the state was active, but the link was not redrawn as active.
2) When pressing the mouse button over a LinkButton, dragging out from the area of the link, and releasing the button, the clicked signal was always emitted, which is not normal behavior (LP:#796640), when dragging out and releasing the button outside, the link should not be clicked. So emitting the clicked signal only if both pressed and released in the linkbuttons region.

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

Nice, clean fix, thanks Robert!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk/widgets/mkit.py'
2--- softwarecenter/ui/gtk/widgets/mkit.py 2011-05-19 09:01:54 +0000
3+++ softwarecenter/ui/gtk/widgets/mkit.py 2011-06-22 09:07:30 +0000
4@@ -1088,9 +1088,10 @@
5 def _on_enter(self, cat, event):
6 if cat == self._button_press_origin:
7 cat.set_state(gtk.STATE_ACTIVE)
8+ self._colorise_label_active()
9 else:
10 cat.set_state(gtk.STATE_PRELIGHT)
11- self._colorise_label_normal()
12+ self._colorise_label_normal()
13 self.window.set_cursor(self._cursor)
14 return
15
16@@ -1137,9 +1138,9 @@
17 else:
18 self._button_press_origin = None
19 cat.set_state(gtk.STATE_PRELIGHT)
20-
21+ gobject.timeout_add(50, emit_clicked)
22+
23 self._colorise_label_normal()
24- gobject.timeout_add(50, emit_clicked)
25 return
26
27 def _on_key_press(self, cat, event):