- Image previews in interfaces are now optional
This commit is contained in:
parent
22b19bdf0b
commit
2b494ba78f
|
@ -11,6 +11,8 @@ __init__ function takes form (self, glossMgr)
|
|||
####################################################
|
||||
#Interfaces require the following to be implemented:
|
||||
####################################################
|
||||
Global Variables:
|
||||
- usePreviewEffects (Bool) = Whether or not the modules should use preview effects
|
||||
Class Name = Interface
|
||||
- addItem(label)
|
||||
- display()
|
||||
|
|
|
@ -10,6 +10,7 @@ from InputQueue import InputQueue
|
|||
#from interfaces.ListMenu import themeLoad
|
||||
|
||||
class Interface(clutter.Group):
|
||||
usePreviewEffects = True # Tells the modules to use any image preview effects where available
|
||||
font = ""
|
||||
menu_item_transition = None
|
||||
zoomLevel = 0.5
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import clutter
|
||||
import pango
|
||||
import gtk
|
||||
import pygtk
|
||||
|
||||
class MenuItem (clutter.Label):
|
||||
zoomLevel = 0.5
|
||||
|
@ -46,11 +48,11 @@ class MenuItem (clutter.Label):
|
|||
|
||||
|
||||
def add_image_from_path(self, path, x, y):
|
||||
self.tempTexture = clutter.Texture()
|
||||
tempTexture = clutter.Texture()
|
||||
pixbuf = gtk.gdk.pixbuf_new_from_file(path)
|
||||
tempTexture.set_pixbuf(pixbuf)
|
||||
|
||||
self.add_image_from_texture(tempTexture, x, y)
|
||||
self.add_image_from_texture(tempTexture)
|
||||
|
||||
def add_image_from_texture(self, texture):
|
||||
if texture is None:
|
||||
|
|
|
@ -9,6 +9,7 @@ from interfaces.MenuItem import MenuItem
|
|||
from InputQueue import InputQueue
|
||||
|
||||
class Interface(clutter.Group):
|
||||
usePreviewEffects = False # Tells the modules NOT to use any effects on the images
|
||||
itemGroup = clutter.Group()
|
||||
menu_image_rotation = 0
|
||||
|
||||
|
@ -122,7 +123,7 @@ class Interface(clutter.Group):
|
|||
tmpTexturesGroup.behaviour_opacity.apply(tmpItem)
|
||||
tmpTexturesGroup.behaviour_scale.apply(tmpItem)
|
||||
|
||||
tmpItem.set_position(tmpTexturesGroup.get_width(), 100)
|
||||
tmpItem.set_position(-tmpTexturesGroup.get_width()*2, -1000)
|
||||
|
||||
self.ang = self.ang + self.step
|
||||
tmpTexturesGroup.show()
|
||||
|
|
|
@ -391,8 +391,11 @@ class Module:
|
|||
img_previewer.add_texture(imgPath)
|
||||
#print imgPath
|
||||
#new_file_list = os.listdir(dirPath)
|
||||
tempItem.itemTexturesGroup = img_previewer
|
||||
img_previewer.set_position(tempItem.menu.menu_image_x, tempItem.menu.menu_image_y)
|
||||
if tempMenu.usePreviewEffects:
|
||||
tempItem.itemTexturesGroup = img_previewer
|
||||
img_previewer.set_position(tempItem.menu.menu_image_x, tempItem.menu.menu_image_y)
|
||||
else:
|
||||
tempItem.add_image_from_path(imgPath, 0, 0)
|
||||
|
||||
tempItem.setAction(self)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ class ThemeMgr:
|
|||
defaultTheme = "default"
|
||||
currentTheme = "default"
|
||||
#currentTheme = "Pear"
|
||||
#currentTheme = "Mich"
|
||||
currentTheme = "Mich"
|
||||
|
||||
def __init__(self, glossMgr):
|
||||
self.stage = glossMgr.stage
|
||||
|
|
Loading…
Reference in New Issue