- Further work on video theming
- Fixed scaling regression from Clutter 0.5 - Began InputQueue generic class
This commit is contained in:
parent
56d42d51aa
commit
242a62a50f
18
GlossMgr.py
18
GlossMgr.py
|
@ -23,10 +23,22 @@ class GlossMgr:
|
|||
self.transition = __import__(transition_path).Transition(self)
|
||||
|
||||
background = self.themeMgr.get_texture("background", None, None)
|
||||
(width, height) = background.get_abs_size()
|
||||
print background.get_abs_size()
|
||||
background.set_anchor_point(0, 0)
|
||||
#background.set_anchor_point_from_gravity(clutter.GRAVITY_CENTER)
|
||||
background.set_depth(-self.stage.get_width())
|
||||
#background.set_scale(1, 1)
|
||||
background.set_width(stage.get_width())
|
||||
background.set_height(stage.get_height())
|
||||
print background.get_abs_size()
|
||||
background.set_anchor_point_from_gravity(clutter.GRAVITY_NORTH_WEST)
|
||||
(width_new, height_new) = background.get_abs_size()
|
||||
#width = width * (width / width_new) + width_new
|
||||
#height = height * (height / height_new) + height_new
|
||||
scale_x = float(width)/float(width_new)
|
||||
scale_y = float(height)/float(height_new)
|
||||
background.set_scale(scale_x, scale_y)
|
||||
print background.get_abs_size()
|
||||
#background.set_width(width)
|
||||
#background.set_height(height)
|
||||
background.show()
|
||||
self.stage.add(background)
|
||||
print "Perspective: " + str(stage.get_perspective())
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
#########################################################
|
||||
# The input queue controls fast user input by queing up
|
||||
# signals and processing them one by one once any timelines
|
||||
# are complete
|
||||
#########################################################
|
||||
|
||||
class InputQueue:
|
||||
NORTH, EAST, SOUTH, WEST = range(4)
|
||||
|
||||
def __init__(self, timeline):
|
||||
self.queue_north = 0
|
||||
self.queue_east = 0
|
||||
self.queue_south = 0
|
||||
self.queue_west = 0
|
||||
|
||||
self.action_north = None
|
||||
self.action_east = None
|
||||
self.action_south = None
|
||||
self.action_west = None
|
||||
|
||||
|
||||
self.timeline = timeline
|
||||
self.timeline.connect('completed', self.flush_queue)
|
||||
|
||||
def flush_queue(self):
|
||||
if self.queue_north > 0:
|
||||
self.selectNext()
|
||||
elif self.moveQueue < 0:
|
||||
self.selectPrevious()
|
||||
|
||||
self.moveQueue = 0
|
3
Menu.py
3
Menu.py
|
@ -209,7 +209,7 @@ class Menu(clutter.Group):
|
|||
self.glossMgr.get_selector_bar().selectItem(self.menuItems[self.selected], self.timeline)
|
||||
|
||||
self.timeline.start()
|
||||
self.moveQueue = 0
|
||||
|
||||
|
||||
def completeMove(self, data):
|
||||
#print self.itemGroup.get_abs_position()
|
||||
|
@ -411,7 +411,6 @@ class ListItem (clutter.Label):
|
|||
|
||||
#If reflection is turned on in the theme, add a reflection texture
|
||||
if self.menu.useReflection:
|
||||
print "reflection!!"
|
||||
self.reflectionTexture = Texture_Reflection(texture)
|
||||
self.itemTexturesGroup.add(self.reflectionTexture)
|
||||
|
||||
|
|
|
@ -34,6 +34,8 @@ class cover_item(clutter.Group):
|
|||
self.main_pic = clutter.Texture()
|
||||
self.main_pic.set_pixbuf(pixbuf)
|
||||
|
||||
|
||||
|
||||
self.main_pic.show()
|
||||
(x, y) = (0, 0)
|
||||
if self.main_pic.get_height() > self.main_pic.get_width():
|
||||
|
@ -50,10 +52,11 @@ class cover_item(clutter.Group):
|
|||
self.main_pic.set_height(height)
|
||||
y = y + (cover_size - height)/2
|
||||
#y = y + (cover_size - height)
|
||||
|
||||
anchor_x = cover_size/2 #self.main_pic.get_width()/2
|
||||
anchor_y = cover_size/2 #self.main_pic.get_height()/2
|
||||
self.set_anchor_point(anchor_x, anchor_y)
|
||||
|
||||
anchor_x = self.main_pic.get_width()/2
|
||||
anchor_y = self.main_pic.get_height()/2
|
||||
#self.main_pic.set_anchor_point(anchor_x, anchor_y)
|
||||
|
||||
self.main_pic.set_position(x, y)
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ from modules.video_player.CoverItem import cover_item
|
|||
class coverViewer(clutter.Group):
|
||||
scaleFactor = 1.4
|
||||
inactiveOpacity = 150
|
||||
backgroundImg = "ui/cover_bg_long.png"
|
||||
covers_size_percent = 0.90 #This is the percentage of the total group size that the covers will take
|
||||
detailBox_height = 160 #Needs a percent
|
||||
|
||||
|
@ -34,16 +33,6 @@ class coverViewer(clutter.Group):
|
|||
self.num_columns = columns
|
||||
self.cover_size = int(self.covers_width / self.num_columns) #A cover will be cover_size * cover_size (X * Y)
|
||||
|
||||
#Add the background
|
||||
pixbuf = gtk.gdk.pixbuf_new_from_file(self.backgroundImg)
|
||||
self.bgImg = clutter.Texture()
|
||||
self.bgImg.set_pixbuf(pixbuf)
|
||||
bgImg_height = height - ((height - (self.cover_size * rows)) / 2) + self.detailBox_height
|
||||
self.bgImg.set_size(width, bgImg_height)
|
||||
#self.bgImg.set_depth(1)
|
||||
self.bgImg.show()
|
||||
self.add(self.bgImg)
|
||||
|
||||
|
||||
#Setup the current min and max viewable rows
|
||||
self.min_visible_rows = 0
|
||||
|
@ -54,7 +43,7 @@ class coverViewer(clutter.Group):
|
|||
self.add(self.covers_group)
|
||||
covers_x = int(width * (1-self.covers_size_percent)/2)
|
||||
covers_y = int(height * (1-self.covers_size_percent)/2)
|
||||
self.covers_group.set_position(covers_x, covers_y)
|
||||
#self.covers_group.set_position(covers_x, covers_y)
|
||||
#self.covers_group.set_depth(1) #self.cover_size)
|
||||
self.covers_group.show()
|
||||
|
||||
|
@ -136,7 +125,7 @@ class coverViewer(clutter.Group):
|
|||
|
||||
alpha = clutter.Alpha(self.timeline, clutter.smoothstep_inc_func)# clutter.ramp_inc_func)
|
||||
self.behaviourNew_scale = clutter.BehaviourScale(scale_start=1, scale_end=self.scaleFactor, alpha=alpha) #clutter.GRAVITY_CENTER)
|
||||
self.behaviourNew_scale.set_property("scale-gravity", 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:
|
||||
|
@ -145,16 +134,16 @@ class coverViewer(clutter.Group):
|
|||
self.behaviourNew_opacity = clutter.BehaviourOpacity(opacity_start=self.inactiveOpacity, opacity_end=255, alpha=alpha)
|
||||
|
||||
self.behaviourOld_scale = clutter.BehaviourScale(scale_start=self.scaleFactor, scale_end=1, alpha=alpha)
|
||||
self.behaviourOld_scale.set_property("scale=gravity", clutter.GRAVITY_CENTER)
|
||||
#self.behaviourOld_scale.set_property("scale-gravity", clutter.GRAVITY_CENTER)
|
||||
self.behaviourOld_z = clutter.BehaviourDepth(depth_start=2, depth_end=1, alpha=alpha)
|
||||
self.behaviourOld_opacity = clutter.BehaviourOpacity(opacity_start=255, opacity_end=self.inactiveOpacity, alpha=alpha)
|
||||
|
||||
(x, y) = incomingTexture.get_position()
|
||||
(x, y) = self.covers_group.get_position()
|
||||
anchor_x = 1000#+incomingTexture.get_width()/2
|
||||
anchor_y = 1000#+incomingTexture.get_height()/2
|
||||
anchor_x = incomingTexture.get_width()/2
|
||||
anchor_y = incomingTexture.get_height()/2
|
||||
#self.covers_group.set_anchor_point(anchor_x, anchor_y)
|
||||
incomingTexture.set_anchor_point(anchor_x, anchor_y)
|
||||
#incomingTexture.set_anchor_point(anchor_x, anchor_y)
|
||||
|
||||
self.behaviourNew_scale.apply(incomingTexture)
|
||||
self.behaviourNew_z.apply(incomingTexture)
|
||||
|
@ -191,7 +180,6 @@ class coverViewer(clutter.Group):
|
|||
|
||||
alpha = clutter.Alpha(self.timeline, clutter.ramp_inc_func)
|
||||
self.behaviourNew_scale = clutter.BehaviourScale(scale_start=1, scale_end=self.scaleFactor, alpha=alpha)
|
||||
self.behaviourNew_scale.set_property("scale-gravity", clutter.GRAVITY_CENTER)
|
||||
self.behaviourNew_z = clutter.BehaviourDepth(depth_start=1, depth_end=2, alpha=alpha)
|
||||
self.behaviourNew_opacity = clutter.BehaviourOpacity(opacity_start=self.inactiveOpacity, opacity_end=255, alpha=alpha)
|
||||
|
||||
|
|
|
@ -90,8 +90,12 @@ class folderMenu(clutter.Group):
|
|||
self.behaviour_rotate_outgoing = clutter.BehaviourRotate(axis=clutter.X_AXIS, direction=rotation_direction, angle_start=0, angle_end=90, alpha=alpha)
|
||||
|
||||
#Need to set the axis of rotation for the covers
|
||||
self.behaviour_rotate_outgoing.set_center(0, self.item_size/2, 0)
|
||||
self.behaviour_rotate_incoming.set_center(0, self.item_size/2, 0)
|
||||
#self.behaviour_rotate_outgoing.set_center(0, self.item_size/2, 0)
|
||||
#self.behaviour_rotate_incoming.set_center(0, self.item_size/2, 0)
|
||||
self.behaviour_rotate_outgoing.set_center(0, 0, 0)
|
||||
self.behaviour_rotate_incoming.set_center(0, 0, 0)
|
||||
|
||||
|
||||
|
||||
self.behaviour_opacity_incoming = clutter.BehaviourOpacity(opacity_start=0, opacity_end=new_viewer.inactiveOpacity, alpha=alpha)
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ class Module():
|
|||
|
||||
coverViewerWidth = 750
|
||||
coverViewerHeight = 600
|
||||
coverViewerPosX = 250
|
||||
coverViewerPosY = 20
|
||||
coverViewerPosX = 300
|
||||
coverViewerPosY = 50
|
||||
coverViewerRows = 3
|
||||
coverViewerColumns = 4
|
||||
cover_size = int(coverViewerWidth / coverViewerColumns)
|
||||
|
@ -57,6 +57,18 @@ class Module():
|
|||
|
||||
def setup_ui(self):
|
||||
self.menu_image = self.glossMgr.themeMgr.get_texture("video_menu_image", None, None)
|
||||
|
||||
#Add the background
|
||||
self.covers_background = self.glossMgr.themeMgr.get_texture("video_covers_background", self.stage, None)
|
||||
#backgroundImg = "ui/cover_bg_long.png"
|
||||
#pixbuf = gtk.gdk.pixbuf_new_from_file(self.backgroundImg)
|
||||
#self.bgImg = clutter.Texture()
|
||||
#self.bgImg.set_pixbuf(pixbuf)
|
||||
#bgImg_height = height - ((height - (self.cover_size * rows)) / 2) + self.detailBox_height
|
||||
#self.bgImg.set_size(width, bgImg_height)
|
||||
#self.bgImg.set_depth(1)
|
||||
#self.bgImg.show()
|
||||
#self.stage.add(self.bgImg)
|
||||
|
||||
def load_base_folders(self, dirPath, folder_menu):
|
||||
try:
|
||||
|
@ -190,32 +202,44 @@ class Module():
|
|||
|
||||
#Create a backdrop for the player. In this case we just use the same background as the menus
|
||||
self.backdrop = glossMgr.get_themeMgr().get_texture("background", None, None) #clutter.CloneTexture(glossMgr.get_skinMgr().get_Background())
|
||||
#self.backdrop = clutter.Rectangle()
|
||||
#self.backdrop.set_color(clutter.color_parse('Black'))
|
||||
self.backdrop.set_size(self.stage.get_width(), self.stage.get_height())
|
||||
self.backdrop.set_opacity(0)
|
||||
self.backdrop.show()
|
||||
self.stage.add(self.backdrop)
|
||||
#Fade the backdrop in
|
||||
timeline_begin = clutter.Timeline(10,40)
|
||||
alpha = clutter.Alpha(timeline_begin, clutter.ramp_inc_func)
|
||||
self.begin_behaviour = clutter.BehaviourOpacity(opacity_start=0, opacity_end=255, alpha=alpha)
|
||||
self.begin_behaviour.apply(self.backdrop)
|
||||
|
||||
|
||||
#Add the covers background
|
||||
self.covers_background.set_opacity(0)
|
||||
self.covers_background.show()
|
||||
self.stage.add(self.covers_background)
|
||||
|
||||
#Add the folders menu
|
||||
self.stage.add(self.folderLibrary[0])
|
||||
self.folderLibrary[0].show()
|
||||
|
||||
#Add the cover viewer
|
||||
self.currentViewer.set_opacity(0)
|
||||
self.currentViewer.show_all()
|
||||
self.currentViewer.show()
|
||||
self.stage.add(self.currentViewer)
|
||||
#cover_x = self.coverViewerPosX #self.stage.get_width() - int(self.coverViewerWidth * 1.1)
|
||||
|
||||
self.currentViewer.set_position(self.coverViewerPosX, self.coverViewerPosY)
|
||||
self.stage.add(self.currentViewer)
|
||||
|
||||
|
||||
#Fade everything in
|
||||
timeline_begin = clutter.Timeline(10,40)
|
||||
alpha = clutter.Alpha(timeline_begin, clutter.ramp_inc_func)
|
||||
self.begin_behaviour = clutter.BehaviourOpacity(opacity_start=0, opacity_end=255, alpha=alpha)
|
||||
|
||||
|
||||
self.begin_behaviour.apply(self.backdrop)
|
||||
self.begin_behaviour.apply(self.covers_background)
|
||||
self.begin_behaviour.apply(self.currentViewer)
|
||||
|
||||
|
||||
|
||||
#self.viewerLibrary[0].set_position(50, 40)
|
||||
self.currentViewer.toggle_details() #Turns the details group on
|
||||
#self.currentViewer.select_first()
|
||||
self.begin_behaviour.apply(self.currentViewer)
|
||||
|
||||
|
||||
timeline_begin.start()
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ from xml.dom import minidom
|
|||
class ThemeMgr:
|
||||
defaultTheme = "default"
|
||||
currentTheme = "default"
|
||||
#currentTheme = "Pear"
|
||||
currentTheme = "Pear"
|
||||
|
||||
def __init__(self, glossMgr):
|
||||
self.stage = glossMgr.stage
|
||||
|
@ -327,7 +327,7 @@ class ThemeMgr:
|
|||
menu.opacityStep2 = int(self.find_child_value(element, "opacity_step2"))
|
||||
|
||||
#setup the menu_image properties
|
||||
menu.useReflection = True == (self.find_child_value(element, "menu_item_texture.use_image_reflections"))
|
||||
menu.useReflection = "True" == (self.find_child_value(element, "menu_item_texture.use_image_reflections"))
|
||||
menu.menu_image_rotation = int(self.find_child_value(element, "menu_item_texture.image_y_rotation"))
|
||||
menu_image_node = self.get_subnode(element, "menu_item_texture")
|
||||
if not menu_image_node is None:
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<gloss-theme>
|
||||
<texture id="background">
|
||||
<image>background.png</image>
|
||||
<texture id="video_covers_background">
|
||||
<image>video_player/cover_bg_long.png</image>
|
||||
<dimensions type="relativeToStage">
|
||||
<width>100%</width>
|
||||
<height>100%</height>
|
||||
<width>80%</width>
|
||||
<height>80%</height>
|
||||
</dimensions>
|
||||
<position type="blah">
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<position type="relativeToStage">
|
||||
<x>15%</x>
|
||||
<y>15%</y>
|
||||
</position>
|
||||
</texture>
|
||||
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 113 KiB |
Loading…
Reference in New Issue