- Themes updated to new structure (Only Gloxygen to go)

This commit is contained in:
noisymime 2008-06-25 13:43:15 +00:00
parent 9cc2264c25
commit cabfdccb4e
8 changed files with 212 additions and 104 deletions

View File

@ -18,10 +18,13 @@ class Interface(clutter.Group):
self.glossMgr = glossMgr
self.stage = self.glossMgr.get_stage()
self.itemGroup = clutter.Group()
self.image_group = None
self.setup_ui(self.glossMgr.themeMgr, "main", self)
self.selected = 0
self.off = 0
self.is_ready = False
self.ang = 0.0
#Setup input queue controller
self.input_queue = InputQueue()
@ -43,13 +46,11 @@ class Interface(clutter.Group):
menu.font = fontString
#setup the menu_image properties
menu.useReflection = "True" == (themeMgr.find_child_value(element, "menu_item_texture.use_image_reflections"))
menu_image_node = themeMgr.get_subnode(element, "menu_item_texture")
if not menu_image_node is None:
#Set the position
(x, y) = themeMgr.get_position(menu_image_node, self.stage)
menu.menu_image_x = int(x)
menu.menu_image_y = int(y)
tmp_frame = themeMgr.get_imageFrame("menu_item_texture")
self.menu_image_size = int(tmp_frame.img_size)
self.use_reflection = tmp_frame.use_reflection
self.menu_image_x = tmp_frame.get_x()
self.menu_image_y = tmp_frame.get_y()
#Setup the menu image transition
image_transition = themeMgr.find_child_value(element, "menu_item_texture.image_transition.name")
@ -83,19 +84,30 @@ class Interface(clutter.Group):
label_width = 0
newItem = WheelListItem(self, itemLabel)
#self.menuItems.append(newItem)
self.itemGroup.add(newItem)
self.step = 360.0 / self.itemGroup.get_n_children()
return newItem
def display(self):
self.step = 360.0 / self.itemGroup.get_n_children()
self.add(self.itemGroup)
if not self.is_ready: self.setup_behaviours()
self.displayed = True
self.selectFirst(False)
self.stage.add(self)
self.itemGroup.show()
self.show()
def setup_behaviours(self):
self.timeline = clutter.Timeline(20, 60)
self.input_queue.set_timeline(self.timeline)
alpha_sine_inc = clutter.Alpha(self.timeline, clutter.sine_inc_func)
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
@ -139,21 +151,17 @@ class Interface(clutter.Group):
tmpItem.behaviour_ellipse.apply(tmpItem)
tmpTexturesGroup.behaviour_opacity.apply(tmpItem)
tmpTexturesGroup.behaviour_scale.apply(tmpItem)
#tmpItem.set_position(-tmpTexturesGroup.get_width()*2, -1000)
self.ang = self.ang + self.step
tmpTexturesGroup.show()
tmpTexturesGroup.show_all()
#tmpItem.show()
self.is_ready = True
self.selectFirst(False)
self.stage.add(self)
self.itemGroup.show()
self.show()
def selectFirst(self, moveBar=False):
if not self.is_ready:
self.setup_behaviours()
def selectFirst(self, moveBar):
for i in range(self.itemGroup.get_n_children()):
ang_start = -90.0
@ -263,6 +271,10 @@ class Interface(clutter.Group):
def get_group_y(self):
return self.itemGroup.get_y()
return int(self.get_current_item().get_y())
def get_selector_bar(self):
return None
def undisplay(self):
pass
class WheelListItem(MenuItem):

View File

@ -101,20 +101,6 @@ class Module:
return False
else:
return True
#This filters for image files starting with "."
def filterPreviewImageFile(self, fileName):
#Strip out any directory info
filename_structure = fileName.split("/")
fileName = filename_structure[ len(filename_structure)-1 ]
extension = fileName[-3:] #Get 3 letter extension
if not extension in self.image_file_types:
return False
elif not fileName[0] == ".":
return False
else:
return True
#This makes sure we only take in sound files
def filterSoundFile(self, fileName):
@ -129,11 +115,12 @@ class Module:
if file_list is None: file_list = []
new_file_list = os.listdir(dirPath)
for fs_object in new_file_list:
if not showHidden and fs_object[0] == ".": break
path = dirPath + "/" + fs_object
if os.path.isdir(path):
self.os_listdir_recursive(path, file_list)
else: file_list.append(path)
if (not showHidden) and (fs_object[0] == "."):
continue
path = dirPath + "/" + fs_object
if os.path.isdir(path):
self.os_listdir_recursive(path, file_list)
else: file_list.append(path)
return file_list
@ -462,6 +449,7 @@ class Module:
img_list = os.listdir(subdir)
img_list_temp = []
for img in img_list:
if img[0] == ".": continue
img = subdir + "/" + img
img_list_temp.append(img)
img_list = img_list_temp
@ -469,12 +457,7 @@ class Module:
#Attempt to get the thumbnail images
#print img_list
img_list_preview = filter(self.filterPreviewImageFile, img_list)
if len(img_list_preview) > 0:
img_list = img_list_preview
#If not, just use the full images
else:
img_list = filter(self.filterImageFile, img_list)
img_list = filter(self.filterImageFile, img_list)
img_previewer = image_previewer(self.glossMgr.stage)
#Set the max preview img sizes (These come from the slideshow.xml theme file

View File

@ -55,4 +55,7 @@ class Module(clutter.Group):
timeline.start()
def add_string_item(self, string):
self.queue.add_item(string)
self.queue.add_item(string)
def stop(self):
self.stage.remove(self)

View File

@ -56,9 +56,9 @@ class coverViewer(ImageGrid):
def get_current_item(self):
if self.textureLibrary[self.currentSelection].isFolder:
return None #self.folderLibrary[(self.currentSelection-len(self.folderLibrary))]
return self.textureLibrary[self.currentSelection]#self.folderLibrary[(self.currentSelection-len(self.folderLibrary))]
else:
return self.textureLibrary[(self.currentSelection-len(self.folderLibrary))+1]
return self.textureLibrary[self.currentSelection]#self.textureLibrary[(self.currentSelection-len(self.folderLibrary))+1]
def set_details_update(self, on_off, details):
self.update_details = on_off

View File

@ -232,7 +232,7 @@ class Module():
#Find whether the current item is a folder or video
item = self.currentViewer.get_current_item()
if item.isFolder:
self.glossMgr.display_msg("Msg", "Its a folder")
self.glossMgr.display_msg("Msg", "Folders are not yet supported (%s)" % item.title.get_text())
else:
self.play_video()

View File

@ -71,10 +71,7 @@
</label_list>
<item_gap>0</item_gap>
<num_visible_elements>4</num_visible_elements>
<!-- The following properties all relate to the image / textures that accompany each menu item -->
<!-- The following properties all relate to the image / textures that accompany each menu item -->
<image_frame id="menu_item_texture">
<dimensions type="relativeToStage">
<width>40%</width>
@ -92,15 +89,6 @@
<options>None</options>
</image_transition>
<!-- These are the opacity and scale values for the 3 possible steps in the menu
Make all the values the same if you do not want these effects -->
<opacity_step0>255</opacity_step0>
<opacity_step1>135</opacity_step1>
<opacity_step2>50</opacity_step2>
<scale_step0>1</scale_step0>
<scale_step1>0.5</scale_step1>
<scale_step2>0.4</scale_step2>
<!-- Used for transitioning between menus -->
<menu_transition>
<name>slide</name>
@ -120,20 +108,6 @@
<y>0</y>
</position>
</texture>
<texture id="selector_bar">
<image>active_bar.png</image>
<!-- This is a special property of selector bar the sets the height of the bar relative to the menu items its selecting -->
<height_percent>120</height_percent>
<dimensions type="relativeToStage">
<width>40%</width>
<height>default</height>
</dimensions>
<position type="relativeToParent">
<x>-50</x>
<y>0</y>
</position>
</texture>
<group id="option_dialog">
<dimensions type="relativeToStage">

View File

@ -1,11 +1,11 @@
<gloss-theme>
<menu id="main">
<interface>ListMenu</interface>
<menu id="main">
<interface>ListMenu2</interface>
<font id="main">
<face>Tahoma</face>
<size id="default">30</size>
<size id="1024x768">40</size>
<size id="1024x768">38</size>
<size id="800x600">30</size>
<size id="1920x1080">25</size>
</font>
@ -19,10 +19,59 @@
<y>30%</y>
</position>
<item_gap>0</item_gap>
<num_visible_elements>6</num_visible_elements>
<label_list id="main_menu">
<font id="main">
<face>Tahoma</face>
<size id="default">30</size>
<size id="1024x768">38</size>
<size id="800x600">30</size>
<size id="1920x1080">25</size>
</font>
<dimensions type="relativeToStage">
<width>40%</width>
<height>40%</height>
</dimensions>
<position type="relativeToStage">
<x>60%</x>
<y>30%</y>
</position>
<!-- This determines the height of each item based on a percentage of the font size.
Eg: 1.00 means that each item will be the same height as the font,
1.50 means that the item will be 1.x times the height as the font etc
-->
<item_height_percent>1.00</item_height_percent>
<!-- These are the opacity and scale values for the 3 possible steps in the menu
Make all the values the same if you do not want these effects -->
<opacity_step0>255</opacity_step0>
<opacity_step1>135</opacity_step1>
<opacity_step2>50</opacity_step2>
<scale_step0>1</scale_step0>
<scale_step1>0.5</scale_step1>
<scale_step2>0.4</scale_step2>
<transition_fps>150</transition_fps>
<transition_frames>30</transition_frames>
<!-- The following properties all relate to the image / textures that accompany each menu item -->
<texture id="selector_bar">
<image>active_bar.png</image>
<!-- This is a special property of selector bar the sets the height of the bar relative to the menu items its selecting -->
<height_percent>1.10</height_percent>
<dimensions type="relativeToStage">
<width>40%</width>
<height>default</height>
</dimensions>
<position type="relativeToParent">
<x>-50</x>
<y>0</y>
</position>
</texture>
</label_list>
<!-- The following properties all relate to the image / textures that accompany each menu item -->
<image_frame id="menu_item_texture">
<dimensions type="relativeToStage">
<width>40%</width>
@ -40,15 +89,6 @@
<options>None</options>
</image_transition>
<!-- These are the opacity and scale values for the 3 possible steps in the menu
Make all the values the same if you do not want these effects -->
<opacity_step0>255</opacity_step0>
<opacity_step1>135</opacity_step1>
<opacity_step2>50</opacity_step2>
<scale_step0>1</scale_step0>
<scale_step1>0.5</scale_step1>
<scale_step2>0.4</scale_step2>
<!-- Used for transitioning between menus -->
<menu_transition>
<name>slide</name>
@ -69,17 +109,113 @@
</position>
</texture>
<texture id="selector_bar">
<image>active_bar.png</image>
<!-- This is a special property of selector bar the sets the height of the bar relative to the menu items its selecting -->
<height_percent>100</height_percent>
<group id="option_dialog">
<dimensions type="relativeToStage">
<width>40%</width>
<height>default</height>
<height>40%</height>
</dimensions>
<position type="relativeToParent">
<x>-50</x>
<y>0</y>
<position type="relativeToStage">
<x>center</x>
<y>center</y>
</position>
</texture>
<label id="dialog_heading">
<font id="font">
<face>Tahoma</face>
<size id="default">30</size>
<size id="1024x768">38</size>
<size id="800x600">30</size>
<size id="1920x1080">25</size>
</font>
<dimensions type="relativeToParent">
<width>90%</width>
<height>15%</height>
</dimensions>
<position type="relativeToParent">
<x>center</x>
<y>2%</y>
</position>
<colour id="colour">
<r>10</r>
<g>10</g>
<b>10</b>
</colour>
</label>
<label_list id="option_dialog_list">
<font id="main">
<face>Tahoma</face>
<size id="default">12</size>
<size id="1024x768">12</size>
<size id="800x600">10</size>
<size id="1920x1080">25</size>
</font>
<dimensions type="relativeToParent">
<width>80%</width>
<height>80%</height>
</dimensions>
<position type="relativeToParent">
<x>10%</x>
<y>20%</y>
</position>
<!-- This determines the height of each item based on a percentage of the font size.
Eg: 1.00 means that each item will be the same height as the font,
1.50 means that the item will be 1.x times the height as the font etc
-->
<item_height_percent>1.20</item_height_percent>
<!-- These are the opacity and scale values for the 3 possible steps in the menu
Make all the values the same if you do not want these effects -->
<opacity_step0>255</opacity_step0>
<opacity_step1>135</opacity_step1>
<opacity_step2>135</opacity_step2>
<scale_step0>1</scale_step0>
<scale_step1>1</scale_step1>
<scale_step2>1</scale_step2>
<transition_fps>30</transition_fps>
<transition_frames>10</transition_frames>
<texture id="inactive_background">
<image>music/songlist_off.png</image>
<dimensions type="relativeToParent">
<width>100%</width>
<height>100%</height>
</dimensions>
<position type="relativeToParent">
<x>-10</x>
<y>0</y>
</position>
</texture>
<texture id="image_up">
<image>up.png</image>
<dimensions type="relativeToStage">
<width>3%</width>
<height>3%</height>
</dimensions>
<position type="relativeToSelf">
<x>0</x>
<y>0</y>
</position>
</texture>
<texture id="image_down">
<image>down.png</image>
<dimensions type="relativeToStage">
<width>3%</width>
<height>3%</height>
</dimensions>
<position type="blah">
<x>0</x>
<y>0</y>
</position>
</texture>
<inactive_background>music/songlist_off.png</inactive_background>
</label_list>
</group>
</gloss-theme>

View File

@ -30,7 +30,7 @@ class Transition:
#self.exit_behaviour_scale.apply(oldGroup)
#self.exit_behaviour_opacity.apply(fromMenu.get_current_item().itemTexturesGroup)
self.exit_behaviour_opacity.apply(fromMenu.image_group)
if not fromMenu.image_group is None: self.exit_behaviour_opacity.apply(fromMenu.image_group)
self.exit_behaviour_opacity.apply(fromMenu)
self.exit_behaviour_path.apply(fromMenu)
@ -55,7 +55,7 @@ class Transition:
self.entrance_behaviour_path = clutter.BehaviourPath(self.alpha, knots_entering)
self.entrance_behaviour_opacity.apply(toMenu.image_group)#get_current_item().get_item_textures())
if not toMenu.image_group is None: self.entrance_behaviour_opacity.apply(toMenu.image_group)#get_current_item().get_item_textures())
self.entrance_behaviour_opacity.apply(toMenu)
self.entrance_behaviour_path.apply(toMenu)
@ -63,7 +63,7 @@ class Transition:
toMenu.display()
#Finally, move the selector bar
fromMenu.get_selector_bar().hide()
if not fromMenu.get_selector_bar() is None: fromMenu.get_selector_bar().hide()
bar = toMenu.get_selector_bar()
if not bar is None:
bar.show()