Updates for r.2000+ of Clutter

This commit is contained in:
noisymime 2008-02-03 12:56:53 +00:00
parent 015b0f37d9
commit 8ae3f5920f
4 changed files with 21 additions and 4 deletions

View File

@ -194,6 +194,8 @@ class MenuSelector(clutter.Texture):
if not self.get_pixbuf() is None:
self.x_offset = int(glossMgr.themeMgr.get_value("texture", "selector_bar", "position.x"))
self.height_percent = float(glossMgr.themeMgr.get_value("texture", "selector_bar", "height_percent")) / float(100)
else:
self.position_0 = (0, 0)
#This is a utility function that gets the coordinates of an that has been scaled
def get_true_abs_position(self, selectee):

View File

@ -93,11 +93,14 @@ class Interface(clutter.Group):
self.step = 360.0 / self.itemGroup.get_n_children()
self.ang = 0.0
(stage_width, stage_height) = self.stage.get_size()
self.add(self.itemGroup)
for i in range(self.itemGroup.get_n_children()):
tmpTexturesGroup =self.itemGroup.get_nth_child(i).itemTexturesGroup
tmpTexturesGroup = self.itemGroup.get_nth_child(i).itemTexturesGroup
tmpItem = self.itemGroup.get_nth_child(i)
self.add(tmpTexturesGroup)
tmpTexturesGroup.behaviour_ellipse = clutter.BehaviourEllipse(\
x = int(stage_width/4),\
y = int(stage_height-stage_height/3),\
@ -114,10 +117,17 @@ class Interface(clutter.Group):
tmpTexturesGroup.behaviour_ellipse.apply(tmpTexturesGroup)
tmpTexturesGroup.behaviour_opacity.apply(tmpTexturesGroup)
tmpTexturesGroup.behaviour_scale.apply(tmpTexturesGroup)
tmpTexturesGroup.behaviour_ellipse.apply(tmpItem)
tmpTexturesGroup.behaviour_opacity.apply(tmpItem)
tmpTexturesGroup.behaviour_scale.apply(tmpItem)
tmpItem.set_position(tmpTexturesGroup.get_width(), 100)
self.ang = self.ang + self.step
tmpTexturesGroup.show()
tmpTexturesGroup.show_all()
tmpItem.show()
self.selectFirst(False)
self.stage.add(self)
@ -182,6 +192,11 @@ class Interface(clutter.Group):
tmpTexturesGroup.behaviour_scale.set_property("y_scale_start", 1)
tmpTexturesGroup.behaviour_scale.set_property("x_scale_end", 0.6)
tmpTexturesGroup.behaviour_scale.set_property("y_scale_end", 0.6)
#Pause the image previewer (if in use)
if tmpTexturesGroup.__class__.__name__ == "image_previewer":
tmpTexturesGroup.stop(None)
elif i == self.selected:
tmpTexturesGroup.behaviour_opacity.set_property("opacity_start", 0x66)
tmpTexturesGroup.behaviour_opacity.set_property("opacity_end", 0xff)
@ -210,7 +225,7 @@ class Interface(clutter.Group):
def getItem(self, index):
return self.itemGroup.get_nth_child(index)
def get_current_item(self):
print "Selected: " + str(self.itemGroup.get_nth_child(self.selected))
#print "Selected: " + str(self.itemGroup.get_nth_child(self.selected))
return self.itemGroup.get_nth_child(self.selected)
class WheelListItem(MenuItem):

View File

@ -130,7 +130,6 @@ class coverViewer(clutter.Group):
alpha = clutter.Alpha(self.timeline, clutter.smoothstep_inc_func)# clutter.ramp_inc_func)
self.behaviourNew_scale = clutter.BehaviourScale(x_scale_start=1, y_scale_start=1, x_scale_end=self.scaleFactor, y_scale_end=self.scaleFactor, alpha=alpha) #clutter.GRAVITY_CENTER)
self.behaviourNew_scale.set_property("scale-gravity", clutter.GRAVITY_CENTER)
self.behaviourNew_z = clutter.BehaviourDepth(depth_start=1, depth_end=2, alpha=alpha)
#If we're performing a roll (See above) then the incoming opacity should start at 0 rather than the normal inactive opacity
if rolling:

View File

@ -69,4 +69,5 @@ class Transition:
def slide_complete(self, timeline, fromMenu):
self.stage.remove(fromMenu)
self.stage.remove(fromMenu.get_current_item().itemTexturesGroup)
#self.stage.remove(fromMenu.get_current_item().itemTexturesGroup)
fromMenu.get_current_item().itemTexturesGroup.get_parent().remove(fromMenu.get_current_item().itemTexturesGroup)