Merge lp:~samuel-buffet/entertainer/fixme-27 into lp:entertainer
Proposed by
Samuel Buffet
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~samuel-buffet/entertainer/fixme-27 |
Merge into: | lp:entertainer |
To merge this branch: | bzr merge lp:~samuel-buffet/entertainer/fixme-27 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Joshua Scotton | Approve | ||
Matt Layman | Approve | ||
Review via email:
|
To post a comment you must log in.
A proposal for FIXME 27, 28 according to http:// wiki.entertaine r-project. com/wiki/ TechnicalDebt0- 3
Samuel,
diff :
=== modified file 'entertainerlib /frontend/ gui/screens/ main_screen. py' frontend/ gui/screens/ main_screen. py 2008-11-17 20:51:41 +0000 frontend/ gui/screens/ main_screen. py 2008-11-24 21:35:11 +0000
--- entertainerlib/
+++ entertainerlib/
@@ -67,7 +67,7 @@
def create_ main_menu( self): show_effects( ))
self. menu.set_ name("mainmenu" )
"""Create main menu of the home screen"""
- self.menu = ScrollMenu(10, 60)
+ self.menu = ScrollMenu(10, 60, self.config.
# Common values for all ScrollMenu items
self. menu.select( index)
@@ -248,6 +248,8 @@
if not index == -1:
+ self.menu.update()
self. update_ preview_ area(self. menu.get_ selected( ))
+
def update_ preview_ area(self, item):
=== modified file 'entertainerlib /frontend/ gui/widgets/ scroll_ menu.py' frontend/ gui/widgets/ scroll_ menu.py 2008-11-17 21:48:56 +0000 frontend/ gui/widgets/ scroll_ menu.py 2008-11-24 21:36:12 +0000
self. __item_ height = item_height
self. __animated = animated
--- entertainerlib/
+++ entertainerlib/
@@ -29,22 +29,29 @@
+ self.scroll_ down_timeline = clutter.Timeline(7, 26) down_timeline. connect( 'new-frame' , self.scroll_ items_down) up_timeline = clutter.Timeline(7, 26) up_timeline. connect( 'new-frame' , self.scroll_ items_up)
clutter. Group.add( self, actor) 'notify: :y', self.actor_ notify_ y)
+ self.scroll_
+
+ self.scroll_
+ self.scroll_
+
def add(self, actor):
"""
Add new menuitem to the menu.
@param item: Label
"""
+ actor.connect(
y = ((len(self.__items) * self.__item_height) +
( self.__ gap * len(self.__items))) notify_ y(actor, None)
actor. set_position( 0, y)
+
+ if y == 0 :
+ # need to do that to update opacity of the first item added
+ self.actor_
- try:
- self.__
- except:
- pass
def remove(self, actor):
"""
@@ -140,53 +147,54 @@
"""
return self.__items[2]
+ def menu_is_ moving( self): down_timeline. is_playing( ) or \ up_timeline. is_playing( ) Alpha(timeline, clutter. ramp_inc_ func) BehaviourPath( (0,self. __gap + self.__ item_height) )) apply(self) items[0] .get_y( ) - se...
+ """Return True if a menu animation is in progress"""
+ return self.scroll_
+ self.scroll_
+
def scroll_down(self):
"""Scroll menu down by one menuitem."""
- if self.__animated:
- #FIXME: Animation doesn't work
- timeline = clutter.Timeline(7, 26)
- alpha = clutter.
- behaviour = clutter.
- alpha, ((0,0),
- for item in self.__items:
- behaviour.
- timeline.start()
- else:
- for item in self.__items:
- item.move_by(0, self.__item_height + self.__gap)
-
- # Set last item to first (menu scrolls)
- last = self.__items[-1]
- last.set_position(
- 0, self.__