Merge lp:~mblayman/entertainer/music-1.0 into lp:entertainer/future
- music-1.0
- Merge into entertainer-future
Proposed by
Matt Layman
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~mblayman/entertainer/music-1.0 |
Merge into: | lp:entertainer/future |
Prerequisite: | lp:~mblayman/entertainer/rss-1.0 |
Diff against target: |
404 lines (+56/-51) 14 files modified
entertainerlib/client/media_player.py (+9/-3) entertainerlib/gui/screens/factory.py (+4/-4) entertainerlib/gui/tabs/albums_tab.py (+2/-0) entertainerlib/gui/tabs/artists_tab.py (+2/-1) entertainerlib/gui/tabs/tab.py (+2/-2) entertainerlib/gui/tabs/tracks_tab.py (+2/-0) entertainerlib/gui/widgets/image_menu.py (+10/-2) entertainerlib/gui/widgets/loading_animation.py (+8/-13) entertainerlib/gui/widgets/progress_bar.py (+4/-5) entertainerlib/gui/widgets/reflection_texture.py (+2/-3) entertainerlib/gui/widgets/rounded_texture.py (+3/-3) entertainerlib/gui/widgets/special_behaviours.py (+0/-6) entertainerlib/gui/widgets/tab_group.py (+2/-2) entertainerlib/gui/widgets/text_menu.py (+6/-7) |
To merge this branch: | bzr merge lp:~mblayman/entertainer/music-1.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Entertainer Release Team | Pending | ||
Review via email: mp+16467@code.launchpad.net |
Commit message
All music screens have been fixed for clutter 1.0.
Description of the change
To post a comment you must log in.
Revision history for this message
Matt Layman (mblayman) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'entertainerlib/client/media_player.py' | |||
2 | --- entertainerlib/client/media_player.py 2009-06-30 01:06:01 +0000 | |||
3 | +++ entertainerlib/client/media_player.py 2009-12-22 03:13:15 +0000 | |||
4 | @@ -105,7 +105,9 @@ | |||
5 | 105 | self.next() | 105 | self.next() |
6 | 106 | elif message.type == gst.MESSAGE_ERROR: | 106 | elif message.type == gst.MESSAGE_ERROR: |
7 | 107 | self.video_texture.set_playing(False) | 107 | self.video_texture.set_playing(False) |
9 | 108 | self.video_texture.set_property("position", 0) | 108 | # XXX: laymansterms - I don't know the implications of removing the |
10 | 109 | # position property. | ||
11 | 110 | #self.video_texture.set_property("position", 0) | ||
12 | 109 | err, debug = message.parse_error() | 111 | err, debug = message.parse_error() |
13 | 110 | self.logger.error("Error: %(err)s, %(debug)s" % \ | 112 | self.logger.error("Error: %(err)s, %(debug)s" % \ |
14 | 111 | {'err': err, 'debug': debug}) | 113 | {'err': err, 'debug': debug}) |
15 | @@ -167,7 +169,9 @@ | |||
16 | 167 | or self.media.get_type() == Playable.VIDEO_STREAM: | 169 | or self.media.get_type() == Playable.VIDEO_STREAM: |
17 | 168 | self.video_texture.set_playing(False) | 170 | self.video_texture.set_playing(False) |
18 | 169 | self.video_texture.set_uri(playable.get_uri()) | 171 | self.video_texture.set_uri(playable.get_uri()) |
20 | 170 | self.video_texture.set_property("position", 0) | 172 | # XXX: laymansterms - I don't know the implications of removing the |
21 | 173 | # position property. | ||
22 | 174 | #self.video_texture.set_property("position", 0) | ||
23 | 171 | 175 | ||
24 | 172 | def get_media(self): | 176 | def get_media(self): |
25 | 173 | '''Get URI of the current media stream.''' | 177 | '''Get URI of the current media stream.''' |
26 | @@ -248,7 +252,9 @@ | |||
27 | 248 | self.stage.set_color(self.bgcolor) | 252 | self.stage.set_color(self.bgcolor) |
28 | 249 | self.stage.remove(self.video_texture) | 253 | self.stage.remove(self.video_texture) |
29 | 250 | self.video_texture.set_playing(False) | 254 | self.video_texture.set_playing(False) |
31 | 251 | self.video_texture.set_property("position", 0) | 255 | # XXX: laymansterms - I don't know the implications of removing the |
32 | 256 | # position property. | ||
33 | 257 | #self.video_texture.set_property("position", 0) | ||
34 | 252 | self.emit('stop') | 258 | self.emit('stop') |
35 | 253 | 259 | ||
36 | 254 | if self._internal_callback_timeout_key is not None: | 260 | if self._internal_callback_timeout_key is not None: |
37 | 255 | 261 | ||
38 | === modified file 'entertainerlib/gui/screens/factory.py' | |||
39 | --- entertainerlib/gui/screens/factory.py 2009-12-22 03:13:15 +0000 | |||
40 | +++ entertainerlib/gui/screens/factory.py 2009-12-22 03:13:15 +0000 | |||
41 | @@ -3,15 +3,15 @@ | |||
42 | 3 | 3 | ||
43 | 4 | # XXX: laymansterms - comment out most of the imports to control how much of | 4 | # XXX: laymansterms - comment out most of the imports to control how much of |
44 | 5 | # clutter needs to be converted | 5 | # clutter needs to be converted |
48 | 6 | #from entertainerlib.gui.screens.artist import Artist | 6 | from entertainerlib.gui.screens.artist import Artist |
49 | 7 | #from entertainerlib.gui.screens.album import Album | 7 | from entertainerlib.gui.screens.album import Album |
50 | 8 | #from entertainerlib.gui.screens.audio_play import AudioPlay | 8 | from entertainerlib.gui.screens.audio_play import AudioPlay |
51 | 9 | #from entertainerlib.gui.screens.disc import Disc | 9 | #from entertainerlib.gui.screens.disc import Disc |
52 | 10 | from entertainerlib.gui.screens.feed import Feed | 10 | from entertainerlib.gui.screens.feed import Feed |
53 | 11 | from entertainerlib.gui.screens.feed_entry import FeedEntry | 11 | from entertainerlib.gui.screens.feed_entry import FeedEntry |
54 | 12 | from entertainerlib.gui.screens.main import Main | 12 | from entertainerlib.gui.screens.main import Main |
55 | 13 | #from entertainerlib.gui.screens.movie import Movie | 13 | #from entertainerlib.gui.screens.movie import Movie |
57 | 14 | #from entertainerlib.gui.screens.music import Music | 14 | from entertainerlib.gui.screens.music import Music |
58 | 15 | #from entertainerlib.gui.screens.photo import Photo | 15 | #from entertainerlib.gui.screens.photo import Photo |
59 | 16 | #from entertainerlib.gui.screens.photo_albums import PhotoAlbums | 16 | #from entertainerlib.gui.screens.photo_albums import PhotoAlbums |
60 | 17 | #from entertainerlib.gui.screens.photographs import Photographs | 17 | #from entertainerlib.gui.screens.photographs import Photographs |
61 | 18 | 18 | ||
62 | === modified file 'entertainerlib/gui/tabs/albums_tab.py' | |||
63 | --- entertainerlib/gui/tabs/albums_tab.py 2009-07-29 03:09:34 +0000 | |||
64 | +++ entertainerlib/gui/tabs/albums_tab.py 2009-12-22 03:13:15 +0000 | |||
65 | @@ -54,11 +54,13 @@ | |||
66 | 54 | # Create album information (displays current menuitem information) | 54 | # Create album information (displays current menuitem information) |
67 | 55 | self.album_title = Label(0.045, "title", 0.22, 0.79, "") | 55 | self.album_title = Label(0.045, "title", 0.22, 0.79, "") |
68 | 56 | self.album_title.set_ellipsize(pango.ELLIPSIZE_END) | 56 | self.album_title.set_ellipsize(pango.ELLIPSIZE_END) |
69 | 57 | self.album_title.set_line_wrap(False) | ||
70 | 57 | self.album_title.width = 0.366 | 58 | self.album_title.width = 0.366 |
71 | 58 | self.add(self.album_title) | 59 | self.add(self.album_title) |
72 | 59 | 60 | ||
73 | 60 | self.album_artist = Label(0.037, "subtitle", 0.22, 0.86, "") | 61 | self.album_artist = Label(0.037, "subtitle", 0.22, 0.86, "") |
74 | 61 | self.album_artist.set_ellipsize(pango.ELLIPSIZE_END) | 62 | self.album_artist.set_ellipsize(pango.ELLIPSIZE_END) |
75 | 63 | self.album_artist.set_line_wrap(False) | ||
76 | 62 | self.album_artist.width = 0.366 | 64 | self.album_artist.width = 0.366 |
77 | 63 | self.add(self.album_artist) | 65 | self.add(self.album_artist) |
78 | 64 | 66 | ||
79 | 65 | 67 | ||
80 | === modified file 'entertainerlib/gui/tabs/artists_tab.py' | |||
81 | --- entertainerlib/gui/tabs/artists_tab.py 2009-07-29 03:09:34 +0000 | |||
82 | +++ entertainerlib/gui/tabs/artists_tab.py 2009-12-22 03:13:15 +0000 | |||
83 | @@ -37,6 +37,7 @@ | |||
84 | 37 | # Create artist label | 37 | # Create artist label |
85 | 38 | self.artist_title = Label(0.0416, "title", 0.22, 0.794, "") | 38 | self.artist_title = Label(0.0416, "title", 0.22, 0.794, "") |
86 | 39 | self.artist_title.set_ellipsize(pango.ELLIPSIZE_END) | 39 | self.artist_title.set_ellipsize(pango.ELLIPSIZE_END) |
87 | 40 | self.artist_title.set_line_wrap(False) | ||
88 | 40 | self.artist_title.width = 0.366 | 41 | self.artist_title.width = 0.366 |
89 | 41 | self.add(self.artist_title) | 42 | self.add(self.artist_title) |
90 | 42 | 43 | ||
91 | @@ -46,7 +47,7 @@ | |||
92 | 46 | self.artist_tracks = Label(0.0365, "subtitle", 0.22, 0.911, "") | 47 | self.artist_tracks = Label(0.0365, "subtitle", 0.22, 0.911, "") |
93 | 47 | self.add(self.artist_tracks) | 48 | self.add(self.artist_tracks) |
94 | 48 | 49 | ||
96 | 49 | # Create artis menu list indicator | 50 | # Create artist menu list indicator |
97 | 50 | self.li = ListIndicator(0.77, 0.8, 0.18, 0.045, | 51 | self.li = ListIndicator(0.77, 0.8, 0.18, 0.045, |
98 | 51 | ListIndicator.VERTICAL) | 52 | ListIndicator.VERTICAL) |
99 | 52 | self.li.set_maximum(len(artists)) | 53 | self.li.set_maximum(len(artists)) |
100 | 53 | 54 | ||
101 | === modified file 'entertainerlib/gui/tabs/tab.py' | |||
102 | --- entertainerlib/gui/tabs/tab.py 2009-07-29 03:09:34 +0000 | |||
103 | +++ entertainerlib/gui/tabs/tab.py 2009-12-22 03:13:15 +0000 | |||
104 | @@ -39,9 +39,9 @@ | |||
105 | 39 | } | 39 | } |
106 | 40 | 40 | ||
107 | 41 | # show/hide animation on the Tab | 41 | # show/hide animation on the Tab |
109 | 42 | self.timeline = clutter.Timeline(30, 60) | 42 | self.timeline = clutter.Timeline(500) |
110 | 43 | self.timeline.connect('completed', self._on_timeline_completed) | 43 | self.timeline.connect('completed', self._on_timeline_completed) |
112 | 44 | self.alpha = clutter.Alpha(self.timeline, clutter.smoothstep_inc_func) | 44 | self.alpha = clutter.Alpha(self.timeline, clutter.EASE_IN_OUT_SINE) |
113 | 45 | self.behaviour = clutter.BehaviourOpacity(0, 255, self.alpha) | 45 | self.behaviour = clutter.BehaviourOpacity(0, 255, self.alpha) |
114 | 46 | self.behaviour.apply(self) | 46 | self.behaviour.apply(self) |
115 | 47 | 47 | ||
116 | 48 | 48 | ||
117 | === modified file 'entertainerlib/gui/tabs/tracks_tab.py' | |||
118 | --- entertainerlib/gui/tabs/tracks_tab.py 2009-07-29 03:09:34 +0000 | |||
119 | +++ entertainerlib/gui/tabs/tracks_tab.py 2009-12-22 03:13:15 +0000 | |||
120 | @@ -34,11 +34,13 @@ | |||
121 | 34 | 34 | ||
122 | 35 | self.track_title = Label(0.045, "title", 0.22, 0.79, "") | 35 | self.track_title = Label(0.045, "title", 0.22, 0.79, "") |
123 | 36 | self.track_title.set_ellipsize(pango.ELLIPSIZE_END) | 36 | self.track_title.set_ellipsize(pango.ELLIPSIZE_END) |
124 | 37 | self.track_title.set_line_wrap(False) | ||
125 | 37 | self.track_title.width = 0.366 | 38 | self.track_title.width = 0.366 |
126 | 38 | self.add(self.track_title) | 39 | self.add(self.track_title) |
127 | 39 | 40 | ||
128 | 40 | self.track_number = Label(0.037, "subtitle", 0.22, 0.86, "") | 41 | self.track_number = Label(0.037, "subtitle", 0.22, 0.86, "") |
129 | 41 | self.track_number.set_ellipsize(pango.ELLIPSIZE_END) | 42 | self.track_number.set_ellipsize(pango.ELLIPSIZE_END) |
130 | 43 | self.track_number.set_line_wrap(False) | ||
131 | 42 | self.track_number.width = 0.366 | 44 | self.track_number.width = 0.366 |
132 | 43 | self.add(self.track_number) | 45 | self.add(self.track_number) |
133 | 44 | 46 | ||
134 | 45 | 47 | ||
135 | === modified file 'entertainerlib/gui/widgets/image_menu.py' | |||
136 | --- entertainerlib/gui/widgets/image_menu.py 2009-07-29 03:09:34 +0000 | |||
137 | +++ entertainerlib/gui/widgets/image_menu.py 2009-12-22 03:13:15 +0000 | |||
138 | @@ -72,9 +72,13 @@ | |||
139 | 72 | pix_buffer = gtk.gdk.pixbuf_new_from_file( | 72 | pix_buffer = gtk.gdk.pixbuf_new_from_file( |
140 | 73 | self.config.theme.getImage("default_movie_art")) | 73 | self.config.theme.getImage("default_movie_art")) |
141 | 74 | self.movie_default = RoundedTexture(0.0, 0.0, 0.1, 0.25, pix_buffer) | 74 | self.movie_default = RoundedTexture(0.0, 0.0, 0.1, 0.25, pix_buffer) |
142 | 75 | self.movie_default.hide() | ||
143 | 76 | self.add(self.movie_default) | ||
144 | 75 | 77 | ||
145 | 76 | self.album_default = Texture( | 78 | self.album_default = Texture( |
146 | 77 | self.config.theme.getImage("default_album_art")) | 79 | self.config.theme.getImage("default_album_art")) |
147 | 80 | self.album_default.hide() | ||
148 | 81 | self.add(self.album_default) | ||
149 | 78 | 82 | ||
150 | 79 | def add_item(self, texture, data): | 83 | def add_item(self, texture, data): |
151 | 80 | """Add a ImageMenuItem from a Texture.""" | 84 | """Add a ImageMenuItem from a Texture.""" |
152 | @@ -118,7 +122,9 @@ | |||
153 | 118 | pix_buffer = gtk.gdk.pixbuf_new_from_file(item[0]) | 122 | pix_buffer = gtk.gdk.pixbuf_new_from_file(item[0]) |
154 | 119 | texture = RoundedTexture(0.0, 0.0, 0.1, 0.25, pix_buffer) | 123 | texture = RoundedTexture(0.0, 0.0, 0.1, 0.25, pix_buffer) |
155 | 120 | else: | 124 | else: |
157 | 121 | texture = clutter.CloneTexture(self.movie_default) | 125 | # XXX: laymansterms - something is fishy. Images aren't showing |
158 | 126 | # up using Clone. Must be related to the clutter warning. | ||
159 | 127 | texture = clutter.Clone(self.movie_default) | ||
160 | 122 | 128 | ||
161 | 123 | self.add_item(texture, item[1]) | 129 | self.add_item(texture, item[1]) |
162 | 124 | 130 | ||
163 | @@ -142,7 +148,9 @@ | |||
164 | 142 | if item[1].has_album_art(): | 148 | if item[1].has_album_art(): |
165 | 143 | texture = Texture(item[0]) | 149 | texture = Texture(item[0]) |
166 | 144 | else: | 150 | else: |
168 | 145 | texture = clutter.CloneTexture(self.album_default) | 151 | # XXX: laymansterms - something is fishy. Images aren't showing |
169 | 152 | # up using Clone. Must be related to the clutter warning. | ||
170 | 153 | texture = clutter.Clone(self.album_default) | ||
171 | 146 | 154 | ||
172 | 147 | self.add_item(texture, item[1]) | 155 | self.add_item(texture, item[1]) |
173 | 148 | 156 | ||
174 | 149 | 157 | ||
175 | === modified file 'entertainerlib/gui/widgets/loading_animation.py' | |||
176 | --- entertainerlib/gui/widgets/loading_animation.py 2009-07-12 17:02:32 +0000 | |||
177 | +++ entertainerlib/gui/widgets/loading_animation.py 2009-12-22 03:13:16 +0000 | |||
178 | @@ -5,12 +5,11 @@ | |||
179 | 5 | import cairo | 5 | import cairo |
180 | 6 | import clutter | 6 | import clutter |
181 | 7 | import gobject | 7 | import gobject |
182 | 8 | from cluttercairo import CairoTexture | ||
183 | 9 | 8 | ||
184 | 10 | from entertainerlib.gui.widgets.base import Base | 9 | from entertainerlib.gui.widgets.base import Base |
185 | 11 | 10 | ||
186 | 12 | 11 | ||
188 | 13 | class LoadingAnimation(Base, CairoTexture): | 12 | class LoadingAnimation(Base, clutter.CairoTexture): |
189 | 14 | """ | 13 | """ |
190 | 15 | Loading animation widget | 14 | Loading animation widget |
191 | 16 | 15 | ||
192 | @@ -23,7 +22,7 @@ | |||
193 | 23 | 22 | ||
194 | 24 | abs_size = self.get_abs_x(size) | 23 | abs_size = self.get_abs_x(size) |
195 | 25 | 24 | ||
197 | 26 | CairoTexture.__init__(self, abs_size, abs_size) | 25 | clutter.CairoTexture.__init__(self, abs_size, abs_size) |
198 | 27 | 26 | ||
199 | 28 | self.set_anchor_point(abs_size / 2, abs_size / 2) | 27 | self.set_anchor_point(abs_size / 2, abs_size / 2) |
200 | 29 | 28 | ||
201 | @@ -83,11 +82,9 @@ | |||
202 | 83 | return self.keep_going | 82 | return self.keep_going |
203 | 84 | 83 | ||
204 | 85 | def hide(self): | 84 | def hide(self): |
210 | 86 | """ | 85 | '''Hide throbber smoothly and stop animation.''' |
211 | 87 | Hide throbber smoothly and stop animation. | 86 | timeline = clutter.Timeline(2000) |
212 | 88 | """ | 87 | alpha = clutter.Alpha(timeline, clutter.EASE_IN_OUT_SINE) |
208 | 89 | timeline = clutter.Timeline(35, 26) | ||
209 | 90 | alpha = clutter.Alpha(timeline, clutter.smoothstep_inc_func) | ||
213 | 91 | self.behaviour = clutter.BehaviourOpacity(255, 0, alpha) | 88 | self.behaviour = clutter.BehaviourOpacity(255, 0, alpha) |
214 | 92 | self.behaviour.apply(self) | 89 | self.behaviour.apply(self) |
215 | 93 | timeline.start() | 90 | timeline.start() |
216 | @@ -100,14 +97,12 @@ | |||
217 | 100 | return True | 97 | return True |
218 | 101 | else: | 98 | else: |
219 | 102 | self.keep_going = False | 99 | self.keep_going = False |
221 | 103 | CairoTexture.hide(self) | 100 | clutter.CairoTexture.hide(self) |
222 | 104 | return False | 101 | return False |
223 | 105 | 102 | ||
224 | 106 | def show(self): | 103 | def show(self): |
228 | 107 | """ | 104 | '''Show throbber and activate animation.''' |
226 | 108 | Show throbber and activate animation | ||
227 | 109 | """ | ||
229 | 110 | self.keep_going = True | 105 | self.keep_going = True |
230 | 111 | gobject.timeout_add(50, self._rotate_throbber) | 106 | gobject.timeout_add(50, self._rotate_throbber) |
232 | 112 | CairoTexture.show(self) | 107 | clutter.CairoTexture.show(self) |
233 | 113 | 108 | ||
234 | 114 | 109 | ||
235 | === modified file 'entertainerlib/gui/widgets/progress_bar.py' | |||
236 | --- entertainerlib/gui/widgets/progress_bar.py 2009-06-30 01:06:01 +0000 | |||
237 | +++ entertainerlib/gui/widgets/progress_bar.py 2009-12-22 03:13:16 +0000 | |||
238 | @@ -5,7 +5,6 @@ | |||
239 | 5 | import math | 5 | import math |
240 | 6 | 6 | ||
241 | 7 | import clutter | 7 | import clutter |
242 | 8 | from cluttercairo import CairoTexture | ||
243 | 9 | 8 | ||
244 | 10 | from entertainerlib.gui.widgets.base import Base | 9 | from entertainerlib.gui.widgets.base import Base |
245 | 11 | from entertainerlib.gui.widgets.label import Label | 10 | from entertainerlib.gui.widgets.label import Label |
246 | @@ -36,12 +35,12 @@ | |||
247 | 36 | self._color = self._color_to_cairo_color( | 35 | self._color = self._color_to_cairo_color( |
248 | 37 | self.config.theme.get_color(color)) | 36 | self.config.theme.get_color(color)) |
249 | 38 | 37 | ||
251 | 39 | self._background = CairoTexture(self.bar_width, self.height) | 38 | self._background = clutter.CairoTexture(self.bar_width, self.height) |
252 | 40 | self._draw_background() | 39 | self._draw_background() |
253 | 41 | self._background.set_position(self.bar_x, 0) | 40 | self._background.set_position(self.bar_x, 0) |
254 | 42 | self.add(self._background) | 41 | self.add(self._background) |
255 | 43 | 42 | ||
257 | 44 | self._foreground = CairoTexture(self.height, self.height) | 43 | self._foreground = clutter.CairoTexture(self.height, self.height) |
258 | 45 | self._foreground.set_anchor_point_from_gravity(clutter.GRAVITY_CENTER) | 44 | self._foreground.set_anchor_point_from_gravity(clutter.GRAVITY_CENTER) |
259 | 46 | self._draw_foreground() | 45 | self._draw_foreground() |
260 | 47 | self._foreground.set_position(self.bar_x, 0) | 46 | self._foreground.set_position(self.bar_x, 0) |
261 | @@ -59,8 +58,8 @@ | |||
262 | 59 | self._hide_timeout_key = None | 58 | self._hide_timeout_key = None |
263 | 60 | self.auto_display = False | 59 | self.auto_display = False |
264 | 61 | self._visible = None | 60 | self._visible = None |
267 | 62 | self._timeline = clutter.Timeline(30, 60) | 61 | self._timeline = clutter.Timeline(500) |
268 | 63 | self._alpha = clutter.Alpha(self._timeline, clutter.smoothstep_inc_func) | 62 | self._alpha = clutter.Alpha(self._timeline, clutter.EASE_IN_OUT_SINE) |
269 | 64 | self._behaviour = clutter.BehaviourOpacity(0, 255, self._alpha) | 63 | self._behaviour = clutter.BehaviourOpacity(0, 255, self._alpha) |
270 | 65 | self._behaviour.apply(self) | 64 | self._behaviour.apply(self) |
271 | 66 | 65 | ||
272 | 67 | 66 | ||
273 | === modified file 'entertainerlib/gui/widgets/reflection_texture.py' | |||
274 | --- entertainerlib/gui/widgets/reflection_texture.py 2009-07-12 17:02:32 +0000 | |||
275 | +++ entertainerlib/gui/widgets/reflection_texture.py 2009-12-22 03:13:16 +0000 | |||
276 | @@ -4,12 +4,11 @@ | |||
277 | 4 | import gtk | 4 | import gtk |
278 | 5 | import cairo | 5 | import cairo |
279 | 6 | import clutter | 6 | import clutter |
280 | 7 | from cluttercairo import CairoTexture | ||
281 | 8 | 7 | ||
282 | 9 | from entertainerlib.gui.widgets.base import Base | 8 | from entertainerlib.gui.widgets.base import Base |
283 | 10 | 9 | ||
284 | 11 | 10 | ||
286 | 12 | class ReflectionTexture(Base, CairoTexture): | 11 | class ReflectionTexture(Base, clutter.CairoTexture): |
287 | 13 | """ | 12 | """ |
288 | 14 | Reflection texture | 13 | Reflection texture |
289 | 15 | 14 | ||
290 | @@ -24,7 +23,7 @@ | |||
291 | 24 | abs_width = self.get_abs_x(width) | 23 | abs_width = self.get_abs_x(width) |
292 | 25 | abs_height = self.get_abs_y(height) | 24 | abs_height = self.get_abs_y(height) |
293 | 26 | 25 | ||
295 | 27 | CairoTexture.__init__(self, abs_width, abs_height) | 26 | clutter.CairoTexture.__init__(self, abs_width, abs_height) |
296 | 28 | 27 | ||
297 | 29 | context = self.cairo_create() | 28 | context = self.cairo_create() |
298 | 30 | ct = gtk.gdk.CairoContext(context) | 29 | ct = gtk.gdk.CairoContext(context) |
299 | 31 | 30 | ||
300 | === modified file 'entertainerlib/gui/widgets/rounded_texture.py' | |||
301 | --- entertainerlib/gui/widgets/rounded_texture.py 2009-07-12 17:02:32 +0000 | |||
302 | +++ entertainerlib/gui/widgets/rounded_texture.py 2009-12-22 03:13:16 +0000 | |||
303 | @@ -1,13 +1,13 @@ | |||
304 | 1 | # Copyright (c) 2009 Entertainer Developers - See COPYING - GPLv2 | 1 | # Copyright (c) 2009 Entertainer Developers - See COPYING - GPLv2 |
305 | 2 | '''Cairo based texture that rounds corners''' | 2 | '''Cairo based texture that rounds corners''' |
306 | 3 | 3 | ||
308 | 4 | from cluttercairo import CairoTexture | 4 | import clutter |
309 | 5 | import gtk | 5 | import gtk |
310 | 6 | 6 | ||
311 | 7 | from entertainerlib.gui.widgets.base import Base | 7 | from entertainerlib.gui.widgets.base import Base |
312 | 8 | 8 | ||
313 | 9 | 9 | ||
315 | 10 | class RoundedTexture(Base, CairoTexture): | 10 | class RoundedTexture(Base, clutter.CairoTexture): |
316 | 11 | """ | 11 | """ |
317 | 12 | Texture with rounded corners | 12 | Texture with rounded corners |
318 | 13 | 13 | ||
319 | @@ -21,7 +21,7 @@ | |||
320 | 21 | abs_width = self.get_abs_x(width) | 21 | abs_width = self.get_abs_x(width) |
321 | 22 | abs_height = self.get_abs_y(height) | 22 | abs_height = self.get_abs_y(height) |
322 | 23 | 23 | ||
324 | 24 | CairoTexture.__init__(self, abs_width, abs_height) | 24 | clutter.CairoTexture.__init__(self, abs_width, abs_height) |
325 | 25 | 25 | ||
326 | 26 | context = self.cairo_create() | 26 | context = self.cairo_create() |
327 | 27 | ct = gtk.gdk.CairoContext(context) | 27 | ct = gtk.gdk.CairoContext(context) |
328 | 28 | 28 | ||
329 | === modified file 'entertainerlib/gui/widgets/special_behaviours.py' | |||
330 | --- entertainerlib/gui/widgets/special_behaviours.py 2009-12-22 03:13:15 +0000 | |||
331 | +++ entertainerlib/gui/widgets/special_behaviours.py 2009-12-22 03:13:16 +0000 | |||
332 | @@ -25,9 +25,6 @@ | |||
333 | 25 | alpha = MAX_ALPHA positioned at end_index | 25 | alpha = MAX_ALPHA positioned at end_index |
334 | 26 | """ | 26 | """ |
335 | 27 | raw_index = alpha_value * (self.end_index - self.start_index) | 27 | raw_index = alpha_value * (self.end_index - self.start_index) |
336 | 28 | # XXX: laymansterms - alpha seems to be 1.0 now so MAX_ALPHA doesn't | ||
337 | 29 | # seem to do anything anymore | ||
338 | 30 | #raw_index /= clutter.MAX_ALPHA | ||
339 | 31 | raw_index += self.start_index | 28 | raw_index += self.start_index |
340 | 32 | 29 | ||
341 | 33 | # we rescale the raw_index to be inside [0, 1[ | 30 | # we rescale the raw_index to be inside [0, 1[ |
342 | @@ -66,9 +63,6 @@ | |||
343 | 66 | def do_alpha_notify(self, alpha_value): | 63 | def do_alpha_notify(self, alpha_value): |
344 | 67 | """Alpha function changing the `font-size` property of Labels.""" | 64 | """Alpha function changing the `font-size` property of Labels.""" |
345 | 68 | size = alpha_value * (self.end_size - self.start_size) | 65 | size = alpha_value * (self.end_size - self.start_size) |
346 | 69 | # XXX: laymansterms - alpha seems to be 1.0 now so MAX_ALPHA doesn't | ||
347 | 70 | # seem to do anything anymore | ||
348 | 71 | #size /= clutter.MAX_ALPHA | ||
349 | 72 | size += self.start_size | 66 | size += self.start_size |
350 | 73 | 67 | ||
351 | 74 | for actor in self.get_actors(): | 68 | for actor in self.get_actors(): |
352 | 75 | 69 | ||
353 | === modified file 'entertainerlib/gui/widgets/tab_group.py' | |||
354 | --- entertainerlib/gui/widgets/tab_group.py 2009-08-16 21:27:15 +0000 | |||
355 | +++ entertainerlib/gui/widgets/tab_group.py 2009-12-22 03:13:16 +0000 | |||
356 | @@ -113,8 +113,8 @@ | |||
357 | 113 | tab_title.set_reactive(True) | 113 | tab_title.set_reactive(True) |
358 | 114 | tab_title.connect('button-press-event', self._on_tab_title_button_press) | 114 | tab_title.connect('button-press-event', self._on_tab_title_button_press) |
359 | 115 | 115 | ||
362 | 116 | timeline = clutter.Timeline(25, 60) | 116 | timeline = clutter.Timeline(500) |
363 | 117 | alpha = clutter.Alpha(timeline, clutter.smoothstep_inc_func) | 117 | alpha = clutter.Alpha(timeline, clutter.EASE_IN_OUT_SINE) |
364 | 118 | behaviour = clutter.BehaviourOpacity(255, 96, alpha) | 118 | behaviour = clutter.BehaviourOpacity(255, 96, alpha) |
365 | 119 | behaviour.apply(tab_title) | 119 | behaviour.apply(tab_title) |
366 | 120 | self.timelines.append((timeline, alpha, behaviour)) | 120 | self.timelines.append((timeline, alpha, behaviour)) |
367 | 121 | 121 | ||
368 | === modified file 'entertainerlib/gui/widgets/text_menu.py' | |||
369 | --- entertainerlib/gui/widgets/text_menu.py 2009-12-22 03:13:15 +0000 | |||
370 | +++ entertainerlib/gui/widgets/text_menu.py 2009-12-22 03:13:16 +0000 | |||
371 | @@ -98,21 +98,20 @@ | |||
372 | 98 | TextMenuItem.__init__(self, width, height, text, extra_text) | 98 | TextMenuItem.__init__(self, width, height, text, extra_text) |
373 | 99 | 99 | ||
374 | 100 | self.move_anchor_point_from_gravity(clutter.GRAVITY_WEST) | 100 | self.move_anchor_point_from_gravity(clutter.GRAVITY_WEST) |
376 | 101 | self.font_size = 0.025 | 101 | self.font_size = 0.03 |
377 | 102 | self.update() | 102 | self.update() |
378 | 103 | 103 | ||
382 | 104 | self.timeline = clutter.Timeline(500) | 104 | self.timeline = clutter.Timeline(200) |
380 | 105 | # XXX: laymansterms - play with different functions to make sure this | ||
381 | 106 | # is the correct one | ||
383 | 107 | alpha = clutter.Alpha(self.timeline, clutter.EASE_IN_OUT_SINE) | 105 | alpha = clutter.Alpha(self.timeline, clutter.EASE_IN_OUT_SINE) |
384 | 108 | self.behaviour = FontSizeBehaviour(alpha) | 106 | self.behaviour = FontSizeBehaviour(alpha) |
385 | 109 | self.behaviour.apply(self) | 107 | self.behaviour.apply(self) |
386 | 110 | 108 | ||
387 | 111 | def animate_in(self): | 109 | def animate_in(self): |
388 | 112 | """Set labels font-size and color when an item gets selected.""" | 110 | """Set labels font-size and color when an item gets selected.""" |
391 | 113 | self.timeline.stop() | 111 | self.behaviour.start_size = 0.03 |
392 | 114 | self.font_size = 0.05 | 112 | self.behaviour.end_size = 0.05 |
393 | 115 | self.color = "menuitem_active" | 113 | self.color = "menuitem_active" |
394 | 114 | self.timeline.start() | ||
395 | 116 | self.update() | 115 | self.update() |
396 | 117 | 116 | ||
397 | 118 | def animate_out(self): | 117 | def animate_out(self): |
398 | @@ -120,7 +119,7 @@ | |||
399 | 120 | self.color = "menuitem_inactive" | 119 | self.color = "menuitem_inactive" |
400 | 121 | self.update() | 120 | self.update() |
401 | 122 | self.behaviour.start_size = 0.05 | 121 | self.behaviour.start_size = 0.05 |
403 | 123 | self.behaviour.end_size = 0.025 | 122 | self.behaviour.end_size = 0.03 |
404 | 124 | self.timeline.start() | 123 | self.timeline.start() |
405 | 125 | 124 | ||
406 | 126 | 125 |
Branch 4 of clutter 1.0 transition.