Merge lp:~mblayman/entertainer/text-menu-1.0 into lp:entertainer/future

Proposed by Matt Layman
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mblayman/entertainer/text-menu-1.0
Merge into: lp:entertainer/future
Prerequisite: lp:~mblayman/entertainer/just-enough
Diff against target: 96 lines (+28/-17)
3 files modified
entertainerlib/gui/widgets/grid_menu.py (+6/-6)
entertainerlib/gui/widgets/selector.py (+17/-9)
entertainerlib/gui/widgets/text_menu.py (+5/-2)
To merge this branch: bzr merge lp:~mblayman/entertainer/text-menu-1.0
Reviewer Review Type Date Requested Status
Entertainer Release Team Pending
Review via email: mp+16465@code.launchpad.net

Commit message

All TextMenu widget problems have been fixed to work with clutter 1.0.

To post a comment you must log in.
Revision history for this message
Matt Layman (mblayman) wrote :

Branch 2 of clutter 1.0 transition.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'entertainerlib/gui/widgets/grid_menu.py'
2--- entertainerlib/gui/widgets/grid_menu.py 2009-12-22 03:12:16 +0000
3+++ entertainerlib/gui/widgets/grid_menu.py 2009-12-22 03:12:17 +0000
4@@ -432,14 +432,14 @@
5 if (x, y) == (self._cursor_x, self._cursor_y):
6 return
7
8- self._cursor_behaviour.clear()
9-
10- start_knot = (self._cursor_x * self._item_width_abs + self._dx,
11+ path = clutter.Path()
12+ path.add_move_to(
13+ self._cursor_x * self._item_width_abs + self._dx,
14 self._cursor_y * self._item_height_abs + self._dy)
15- stop_knot = (x * self._item_width_abs + self._dx,
16+ path.add_line_to(
17+ x * self._item_width_abs + self._dx,
18 y * self._item_height_abs + self._dy)
19-
20- self._cursor_behaviour.append_knots(start_knot, stop_knot)
21+ self._cursor_behaviour.set_path(path)
22
23 self._cursor_x, self._cursor_y = x, y
24 self._cursor_timeline.set_duration(duration)
25
26=== modified file 'entertainerlib/gui/widgets/selector.py'
27--- entertainerlib/gui/widgets/selector.py 2009-12-22 03:12:16 +0000
28+++ entertainerlib/gui/widgets/selector.py 2009-12-22 03:12:17 +0000
29@@ -27,13 +27,21 @@
30 self.add(self.glow)
31
32 # Animate selector (Glow effect with glow overlay texture)
33- # XXX: laymansterms - play with the time length to find what will work.
34- self.timeline = clutter.Timeline(500)
35- self.timeline.set_loop(True)
36- # XXX: laymansterms - try different functions to see what fits best.
37- self.alpha = clutter.Alpha(self.timeline, clutter.EASE_IN_OUT_SINE)
38- self.behaviour = clutter.BehaviourOpacity(0, 255, self.alpha)
39- self.behaviour.apply(self.glow)
40+ self.in_time = clutter.Timeline(1500)
41+ self.in_alpha = clutter.Alpha(self.in_time, clutter.EASE_IN_OUT_SINE)
42+ self.in_behaviour = clutter.BehaviourOpacity(0, 255, self.in_alpha)
43+ self.in_behaviour.apply(self.glow)
44+
45+ self.out_time = clutter.Timeline(1500)
46+ self.out_alpha = clutter.Alpha(self.out_time, clutter.EASE_IN_OUT_SINE)
47+ self.out_behaviour = clutter.BehaviourOpacity(255, 0, self.out_alpha)
48+ self.out_behaviour.apply(self.glow)
49+
50+ self.score = clutter.Score()
51+ self.score.set_loop(True)
52+ self.score.append(timeline=self.in_time)
53+ # Link the out Timeline so that there is a smooth fade out.
54+ self.score.append(timeline=self.out_time, parent=self.in_time)
55
56 def set_size(self, width, height):
57 """Overrides clutter.Actor.set_size()"""
58@@ -42,12 +50,12 @@
59
60 def stop_animation(self):
61 """Stop selector animation"""
62- self.timeline.stop()
63+ self.score.stop()
64 self.glow.set_opacity(0)
65
66 def start_animation(self):
67 """Start selector animation"""
68- self.timeline.start()
69+ self.score.start()
70
71 def hide(self):
72 """Overrides clutter.Actor.hide()"""
73
74=== modified file 'entertainerlib/gui/widgets/text_menu.py'
75--- entertainerlib/gui/widgets/text_menu.py 2009-07-29 03:09:34 +0000
76+++ entertainerlib/gui/widgets/text_menu.py 2009-12-22 03:12:17 +0000
77@@ -71,6 +71,7 @@
78 self.label.font_size = self.font_size
79 self.label.set_text(first_line)
80 self.label.position = (0.01, (self.height - self.label.height) / 2)
81+ self.label.set_line_wrap(False)
82 self.label.set_ellipsize(pango.ELLIPSIZE_END)
83
84 # Set extra text
85@@ -100,8 +101,10 @@
86 self.font_size = 0.025
87 self.update()
88
89- self.timeline = clutter.Timeline(fps=100, duration=500)
90- alpha = clutter.Alpha(self.timeline, clutter.smoothstep_inc_func)
91+ self.timeline = clutter.Timeline(500)
92+ # XXX: laymansterms - play with different functions to make sure this
93+ # is the correct one
94+ alpha = clutter.Alpha(self.timeline, clutter.EASE_IN_OUT_SINE)
95 self.behaviour = FontSizeBehaviour(alpha)
96 self.behaviour.apply(self)
97

Subscribers

People subscribed via source and target branches