Merge lp:~xapantu/beat-box/fix-739679 into lp:beat-box

Proposed by Scott Ringwelski
Status: Merged
Approved by: Scott Ringwelski
Approved revision: 174
Merged at revision: 176
Proposed branch: lp:~xapantu/beat-box/fix-739679
Merge into: lp:beat-box
Diff against target: 74 lines (+19/-7)
1 file modified
src/Widgets/RatingWidget.vala (+19/-7)
To merge this branch: bzr merge lp:~xapantu/beat-box/fix-739679
Reviewer Review Type Date Requested Status
Scott Ringwelski Pending
Review via email: mp+62227@code.launchpad.net

Description of the change

merging for better rating widget

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Widgets/RatingWidget.vala'
2--- src/Widgets/RatingWidget.vala 2011-05-21 18:35:11 +0000
3+++ src/Widgets/RatingWidget.vala 2011-05-25 01:37:24 +0000
4@@ -2,7 +2,7 @@
5 using Gdk;
6
7 public class BeatBox.RatingWidget : EventBox {
8- private int rating;
9+ internal int rating;
10
11 private bool centered;
12 private Pixbuf _canvas;
13@@ -29,12 +29,19 @@
14
15 add_events(Gdk.EventMask.BUTTON_PRESS_MASK
16 | Gdk.EventMask.BUTTON_RELEASE_MASK
17- | Gdk.EventMask.POINTER_MOTION_MASK);
18+ | Gdk.EventMask.POINTER_MOTION_MASK
19+ | Gdk.EventMask.LEAVE_NOTIFY_MASK);
20 //motion_notify_event.connect(mouseOver);
21 button_press_event.connect(buttonPress);
22 expose_event.connect(exposeEvent);
23 }
24
25+ public override bool leave_notify_event(Gdk.EventCrossing ev)
26+ {
27+ updateRating(rating);
28+ return true;
29+ }
30+
31 public void set_rating(int new_rating) {
32 if(rating == new_rating)
33 return;
34@@ -49,7 +56,7 @@
35 }
36
37 /* just draw new rating */
38- /*public override bool motion_notify_event(EventMotion event) {
39+ public override bool motion_notify_event(EventMotion event) {
40 int new_rating = 0;
41
42 int buffer = (this.allocation.width - width_request)/2;
43@@ -61,7 +68,7 @@
44 updateRating(new_rating);
45
46 return true;
47- }*/
48+ }
49
50 /* draw new rating AND update rating */
51 public virtual bool buttonPress(Gdk.EventButton event) {
52@@ -125,9 +132,9 @@
53
54 public override bool motion_notify_event(Gdk.EventMotion ev)
55 {
56- //rating.motion_notify_event(ev);
57- rating.queue_draw();
58- return true;
59+ rating.motion_notify_event(ev);
60+ //rating.queue_draw();
61+ return false;
62 }
63
64 public override bool expose_event(Gdk.EventExpose expose)
65@@ -144,4 +151,9 @@
66 activate();
67 return true;
68 }
69+ public override bool leave_notify_event(Gdk.EventCrossing ev)
70+ {
71+ rating.updateRating(rating.rating);
72+ return true;
73+ }
74 }

Subscribers

People subscribed via source and target branches