- Fixes to image_preview

- Minor fixes to label_list
This commit is contained in:
noisymime 2008-06-15 12:29:44 +00:00
parent 3378b333b1
commit c3c350d957
3 changed files with 19 additions and 7 deletions

View File

@ -91,6 +91,7 @@ class ImageFrame(clutter.Group):
if self.reflection == toggle:
return
self.use_reflection = toggle
if not self.reflection is None:
self.remove(self.reflection)
self.reflection = None

View File

@ -6,6 +6,7 @@ import random
import math
from ReflectionTexture import Texture_Reflection
from ui_elements.image_frame import ImageFrame
from ui_elements.image_clone import ImageClone
from utils.ThumbnailMgr import ThumbnailMgr
class image_previewer(clutter.Group):
@ -164,8 +165,21 @@ class image_previewer(clutter.Group):
effect.start()
def get_rand_tex(self):
max_iterations = 20
iteration = 0
rand = random.randint(0, len(self.textures)-1)
return self.textures[rand]
rand = self.textures[rand]
while (not rand == self.tex1) and (not rand == self.tex2) and (not rand == self.tex3) and (iteration < max_iterations):
rand = random.randint(0, len(self.textures)-1)
rand = self.textures[rand]
iteration += 1
if iteration == max_iterations:
#If here, it means there wasn't enough images to have 3 different ones
#We use a clone to avoid flickering
rand = ImageClone(img_frame = rand)
return rand
def get_next_tex(self):
self.nextTexture = self.get_rand_tex()

View File

@ -234,9 +234,9 @@ class LabelList(clutter.Group):
elif (i == self.selected+1) and (i <= self.displayMax-1):
#Item below the selected
self.items[i].scaleLabel(ListItem.SCALE_MEDIUM, self.timeline)
elif (i < self.displayMin) or (i > self.displayMax):
#elif (i < self.displayMin) or (i > self.displayMax):
#Item is off screen
self.items[i].scaleLabel(ListItem.SCALE_OFFSCREEN, self.timeline)
# self.items[i].scaleLabel(ListItem.SCALE_OFFSCREEN, self.timeline)
else:
#All other items
self.items[i].scaleLabel(ListItem.SCALE_NONE, self.timeline)
@ -333,10 +333,7 @@ class LabelList(clutter.Group):
#When the menu needs to display a new item from the top or bottom, it rolls
# The distance the menu moves is the distance (in pixels) between the incoming item and the selector bar
def rollList(self, direction, timeline):
def rollList(self, direction, timeline):
(group_x, group_y) = self.item_group.get_position()
if direction == self.DIRECTION_DOWN: