Author: dmeyer
Date: Tue May 1 11:35:34 2007
New Revision: 9536
Modified:
trunk/ui/share/skins/main/basic.fxd
trunk/ui/src/gui/__init__.py
trunk/ui/src/gui/areas/area.py
trunk/ui/src/gui/areas/listing_area.py
trunk/ui/src/gui/theme.py
trunk/ui/src/mainmenu.py
trunk/ui/src/menu/item.py
Log:
remove old icon code from gui
Modified: trunk/ui/share/skins/main/basic.fxd
==============================================================================
--- trunk/ui/share/skins/main/basic.fxd (original)
+++ trunk/ui/share/skins/main/basic.fxd Tue May 1 11:35:34 2007
@@ -13,8 +13,6 @@
<skin geometry="800x600">
<iconset theme="blurr"/>
- <setvar name="box_under_icon" val="0"/>
-
<!-- Items of the main menu -->
<main>
<item label="tv" name="TV"/>
Modified: trunk/ui/src/gui/__init__.py
==============================================================================
--- trunk/ui/src/gui/__init__.py (original)
+++ trunk/ui/src/gui/__init__.py Tue May 1 11:35:34 2007
@@ -18,7 +18,7 @@
#
# Submodule: import gui.theme
# Dependencies: freevo, gui.font
-# Content: get, set, font, image, icon, set_base_fxd
+# Content: get, set, font, image, set_base_fxd
# Description: This module reads theme fxd files and provides an interface to
# the objects defined in the theme
#
Modified: trunk/ui/src/gui/areas/area.py
==============================================================================
--- trunk/ui/src/gui/areas/area.py (original)
+++ trunk/ui/src/gui/areas/area.py Tue May 1 11:35:34 2007
@@ -156,7 +156,6 @@
self.settings = self.__calc_geometry(area.layout.content)
self.settings.images = area.images
self.settings.changed = True
- self.settings.box_under_icon = settings.box_under_icon
self.settings.icon_dir = settings.icon_dir
elif area and self.__layout != area.layout:
@@ -166,7 +165,6 @@
self.settings = self.__calc_geometry(area.layout.content)
self.settings.images = area.images
self.settings.changed = True
- self.settings.box_under_icon = settings.box_under_icon
self.settings.icon_dir = settings.icon_dir
if not area.visible or not self.__layout:
Modified: trunk/ui/src/gui/areas/listing_area.py
==============================================================================
--- trunk/ui/src/gui/areas/listing_area.py (original)
+++ trunk/ui/src/gui/areas/listing_area.py Tue May 1 11:35:34 2007
@@ -8,8 +8,6 @@
# listing areas for menus. It inherits from Area (area.py) and the update
# function will be called to update this area.
#
-# TODO: o fix icon code which is deactivated right now
-#
# -----------------------------------------------------------------------------
# Freevo - A Home Theater PC framework
# Copyright (C) 2002-2005 Krister Lagerstrom, Dirk Meyer, et al.
@@ -248,39 +246,27 @@
and is only used once to split the huge update function into smaller
once.
"""
- icon_x = 0
- icon = None
align = val.align or settings.align
menu = self.menu
- x_icon = 0
-
- icon_type = None
- if hasattr(val, 'icon'):
- icon_type = val.icon
text = choice.name
if not text:
text = "unknown"
- if not choice.icon and not icon_type:
- if choice.type == 'playlist':
- text = 'PL: %s' % text
+ if choice.type == 'playlist':
+ text = 'PL: %s' % text
- if choice.type == 'dir' and choice.parent and \
+ if choice.type == 'dir' and choice.parent and \
choice.parent.type != 'mediamenu':
- text = '[%s]' % text
+ text = '[%s]' % text
#
# draw the rectangle below the item
#
if val.rectangle:
r = val.rectangle.calculate(width, val.font.height)[2]
- b = self.drawbox(x + hskip + r.x + x_icon - \
- self.settings.box_under_icon * x_icon,
- y + vskip + r.y,
- r.width - icon_x + \
- self.settings.box_under_icon * icon_x,
- r.height, r)
+ b = self.drawbox(x + hskip + r.x, y + vskip + r.y,
+ r.width, r.height, r)
gui_objects.append(b)
#
@@ -330,13 +316,13 @@
self.last_tvs = (sn[0], tvs_w)
s = self.drawstring(' - %s' % sn[3], val.font, settings,
- x=x + hskip + icon_x + tvs_w,
- y=y + vskip, width=width-icon_x-tvs_w,
+ x=x + hskip + tvs_w,
+ y=y + vskip, width=width-tvs_w,
height=-1, align_h='left', dim=False,
mode='hard')
gui_objects.append(s)
s = self.drawstring(sn[2], val.font, settings,
- x=x + hskip + icon_x + tvs_w - 100,
+ x=x + hskip + tvs_w - 100,
y=y + vskip, width=100, height=-1,
align_h='right', dim=False, mode='hard')
gui_objects.append(s)
@@ -356,10 +342,10 @@
# item _must_ have that many tabs as the table needs!!!
#
if hasattr(menu, 'table'):
- table_x = x + hskip + x_icon
+ table_x = x + hskip
table_text = text.split('\t')
for i in range(len(menu.table)):
- table_w = ((width-icon_x-len(table_text)*5)*\
+ table_w = ((width-len(table_text)*5)*\
menu.table[i]) / 100
if i != len(menu.table) - 1:
table_w += 5
@@ -387,8 +373,8 @@
#
# draw the text
#
- s = self.drawstring(text, val.font, settings, x=x + hskip + x_icon,
- y=y + vskip, width=width-icon_x, height=-1,
+ s = self.drawstring(text, val.font, settings, x=x + hskip,
+ y=y + vskip, width=width, height=-1,
align_h=val.align, mode='hard', dim=True)
if s:
gui_objects.append(s)
Modified: trunk/ui/src/gui/theme.py
==============================================================================
--- trunk/ui/src/gui/theme.py (original)
+++ trunk/ui/src/gui/theme.py Tue May 1 11:35:34 2007
@@ -6,7 +6,7 @@
#
# This module handles the current theme for Freevo based on the fxd settings.
# Besides getting the current theme and changing it, there are also functions
-# to get a font, an image or an icon based on the name. All functions for the
+# to get a font or an image based on the name. All functions for the
# interface to Freevo are on the top of this file.
#
# TODO: o major cleanup
@@ -42,7 +42,7 @@
# -----------------------------------------------------------------------------
# list of functions this module provides
-__all__ = [ 'get', 'set', 'font', 'image', 'icon', 'set_base_fxd', 'signals' ]
+__all__ = [ 'get', 'set', 'font', 'image', 'set_base_fxd', 'signals' ]
# python imports
import os
@@ -146,15 +146,6 @@
return current_theme.get_image(name)
-def icon(name):
- """
- Get the icon filename with the given name. This function will
- search the icon in the theme icon directory. If no icon is found
- this function will return None.
- """
- return current_theme.get_icon(name)
-
-
def getimage(base, default=None):
"""
return the image base+'.png' or base+'.jpg' if one of them exists.
@@ -330,18 +321,15 @@
if source:
self.label = source.label
self.name = source.name
- self.icon = source.icon
self.image = source.image
else:
self.label = ''
self.name = ''
- self.icon = ''
self.image = ''
def parse(self, node, scale, c_dir=''):
self.label = attr_str(node, "label", self.label)
self.name = attr_str(node, "name", self.name)
- self.icon = attr_str(node, "icon", self.icon)
self.image = attr_str(node, "image", self.image)
@@ -402,7 +390,6 @@
'name' : ('str', 0),
'visible' : ('visible', 0),
'border' : ('visible', 0),
- 'icon' : ('str', 0),
'ellipses' : ('str', 0),
'dim' : ('visible', 0),
}
@@ -695,7 +682,7 @@
"""
class for <item> inside content
"""
- VARS = ('font', 'align', 'valign', 'height', 'width', 'icon')
+ VARS = ('font', 'align', 'valign', 'height', 'width')
def __init__(self, source=None):
XMLData.__init__(self, self.VARS, source)
self.rectangle = None
@@ -1134,10 +1121,6 @@
self.fxd_files = []
- # variables set by set_var
- self.all_variables = ('box_under_icon', )
- self.box_under_icon = 0
-
# load plugin skin files:
pdir = os.path.join(SHAREDIR, 'skins/plugins')
if os.path.isdir(pdir):
@@ -1219,14 +1202,6 @@
self.__popup = attr_str(node, 'layout', self.__popup)
- elif node.name == u'setvar':
- for v in self.all_variables:
- if node.attrs[('', 'name')].upper() == v.upper():
- try:
- setattr(self, v, int(node.attrs[('', 'val')]))
- except ValueError:
- setattr(self, v, node.attrs[('', 'val')])
-
else:
if node.children and node.children[0].name == 'style':
self.__sets[node.name] = Menu()
@@ -1385,17 +1360,6 @@
return None
- def get_icon(self, name):
- """
- Get the icon object 'name'. Return the icon in the theme dir if it
- exists, else try the normal image dir. If not found, return ''
- """
- icon = util.getimage(os.path.join(self.icon_dir, name))
- if icon:
- return icon
- return util.getimage(os.path.join(ICON_DIR, name), '')
-
-
def load(self, file):
"""
load and parse the skin file
Modified: trunk/ui/src/mainmenu.py
==============================================================================
--- trunk/ui/src/mainmenu.py (original)
+++ trunk/ui/src/mainmenu.py Tue May 1 11:35:34 2007
@@ -52,11 +52,10 @@
a MainMenuPlugin.
"""
def __init__( self, parent=None, name=u'', type=None, image=None,
- icon=None, skin_type=None):
+ skin_type=None):
Item.__init__(self, parent)
self.name = name
- self.icon = icon
self.image = image
self.type = type
@@ -76,8 +75,6 @@
skin_info = skin_info[skin_type]
self.name = _(skin_info.name)
self.image = skin_info.image
- if skin_info.icon:
- self.icon = os.path.join(theme.icon_dir, skin_info.icon)
imagedir = theme.mainmenu.imagedir
if not self.image and imagedir:
Modified: trunk/ui/src/menu/item.py
==============================================================================
--- trunk/ui/src/menu/item.py (original)
+++ trunk/ui/src/menu/item.py Tue May 1 11:35:34 2007
@@ -62,7 +62,6 @@
Init the item. Sets all needed variables, if parent is given also
inherit some settings from there.
"""
- self.icon = None
self.info = {}
self.menu = None
if type is not None:
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog