Update of /cvsroot/freevo/freevo/src/gui/areas
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1897/areas
Modified Files:
listing_area.py
Log Message:
create image thumbnails on-the-fly
Index: listing_area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/areas/listing_area.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** listing_area.py 30 Dec 2004 11:28:07 -0000 1.15
--- listing_area.py 10 Apr 2005 18:00:21 -0000 1.16
***************
*** 474,478 ****
image = self.imagelib.item_image(choice, (val.width, val.height),
self.settings.icon_dir, force=True,
! cache=self.imagecache)
if image:
i_w, i_h = image.width, image.height
--- 474,478 ----
image = self.imagelib.item_image(choice, (val.width, val.height),
self.settings.icon_dir, force=True,
! cache=self.imagecache, bg=True)
if image:
i_w, i_h = image.width, image.height
***************
*** 527,531 ****
self.__default_val.height),
self.settings.icon_dir, force=False,
! cache=self.imagecache)
if len(self.__cache_listing) == 1:
# Nothing more to cache, return False to stop this callback
--- 527,531 ----
self.__default_val.height),
self.settings.icon_dir, force=False,
! cache=self.imagecache, bg=True)
if len(self.__cache_listing) == 1:
# Nothing more to cache, return False to stop this callback
***************
*** 544,549 ****
do the real update.
"""
! menu = self.menu
! settings = self.settings
if not len(menu.choices):
--- 544,549 ----
do the real update.
"""
! menu = self.menu
! settings = self.settings
if not len(menu.choices):
***************
*** 592,596 ****
if settings.type != 'text' and end < len(menu.choices):
self.__cache_listing = menu.choices[end:end + cols * rows]
! notifier.addTimer(0, notifier.Callback(self.__cache_next_image))
# do some checking if we have to redraw everything
--- 592,596 ----
if settings.type != 'text' and end < len(menu.choices):
self.__cache_listing = menu.choices[end:end + cols * rows]
! notifier.addTimer(100, notifier.Callback(self.__cache_next_image))
# do some checking if we have to redraw everything
***************
*** 610,614 ****
self.clear(keep_settings=True)
! for choice in listing:
draw_this_item = True
--- 610,614 ----
self.clear(keep_settings=True)
! for index, choice in enumerate(listing):
draw_this_item = True
***************
*** 617,633 ****
#
if redraw:
! self.last_listing.append((choice.name, choice.image, []))
! gui_objects = self.last_listing[-1][2]
else:
- index = listing.index(choice)
# check if the item is still the same
! if self.last_listing[index][:2] != (choice.name,
choice.image):
for o in self.last_listing[index][2]:
o.unparent()
gui_objects = []
! self.last_listing[index] = choice.name, choice.image, \
! gui_objects
elif choice == self.last_selection or choice == menu.selected:
! gui_objects = self.last_listing[index][2]
while len(gui_objects):
o = gui_objects.pop()
--- 617,634 ----
#
if redraw:
! gui_objects = []
! listing_info = [ choice.name, None, gui_objects ]
! self.last_listing.append(listing_info)
else:
# check if the item is still the same
! if self.last_listing[index][:2] != [choice.name,
choice.image]:
for o in self.last_listing[index][2]:
o.unparent()
gui_objects = []
! listing_info = [ choice.name, None, gui_objects ]
! self.last_listing[index] = listing_info
elif choice == self.last_selection or choice == menu.selected:
! listing_info = self.last_listing[index]
! gui_objects = listing_info[2]
while len(gui_objects):
o = gui_objects.pop()
***************
*** 655,670 ****
self.__default_val = val
! if draw_this_item and settings.type == 'text':
! # draw item for text listing
! self.__draw_text_listing_item(choice, (x,y), settings, val,
! hspace, vspace, gui_objects,
! width, hskip, vskip)
! if draw_this_item and settings.type == 'image' or \
! settings.type == 'image+text':
! # draw item for image listing
! self.__draw_image_listing_item(choice, (x,y), settings, val,
! hspace, vspace, gui_objects)
# calculate next item position
if current_col == cols:
--- 656,675 ----
self.__default_val = val
! if draw_this_item:
! if settings.type == 'text':
! # draw item for text listing
! self.__draw_text_listing_item(choice, (x,y), settings,
val,
! hspace, vspace, gui_objects,
! width, hskip, vskip)
! elif settings.type == 'image' or \
! settings.type == 'image+text':
! # draw item for image listing
! self.__draw_image_listing_item(choice, (x,y), settings,
! val, hspace, vspace,
! gui_objects)
+ listing_info[1] = choice.image
+
# calculate next item position
if current_col == cols:
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog