forked from len0rd/rockbox
Theme Editor: Enabled __list_icons__ special file name for %xl tags
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27799 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b477463d9c
commit
6dd974a7a3
1 changed files with 18 additions and 4 deletions
|
@ -640,6 +640,7 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
|
||||||
int x, y, tiles, tile, maxWidth, maxHeight, width, height;
|
int x, y, tiles, tile, maxWidth, maxHeight, width, height;
|
||||||
char c, hAlign, vAlign;
|
char c, hAlign, vAlign;
|
||||||
RBImage* image;
|
RBImage* image;
|
||||||
|
QPixmap temp;
|
||||||
|
|
||||||
/* Two switch statements to narrow down the tag name */
|
/* Two switch statements to narrow down the tag name */
|
||||||
switch(element->tag->name[0])
|
switch(element->tag->name[0])
|
||||||
|
@ -774,14 +775,27 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
|
||||||
case 'l':
|
case 'l':
|
||||||
/* %xl */
|
/* %xl */
|
||||||
id = element->params[0].data.text;
|
id = element->params[0].data.text;
|
||||||
filename = info.settings()->value("imagepath", "") + "/" +
|
if(element->params[1].data.text == QString("__list_icons__"))
|
||||||
element->params[1].data.text;
|
{
|
||||||
|
filename = info.settings()->value("iconset", "");
|
||||||
|
filename.replace(".rockbox",
|
||||||
|
info.settings()->value("themebase"));
|
||||||
|
temp.load(filename);
|
||||||
|
if(!temp.isNull())
|
||||||
|
{
|
||||||
|
tiles = temp.height() / temp.width();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
filename = info.settings()->value("imagepath", "") + "/" +
|
||||||
|
element->params[1].data.text;
|
||||||
|
tiles = 1;
|
||||||
|
}
|
||||||
x = element->params[2].data.number;
|
x = element->params[2].data.number;
|
||||||
y = element->params[3].data.number;
|
y = element->params[3].data.number;
|
||||||
if(element->params_count > 4)
|
if(element->params_count > 4)
|
||||||
tiles = element->params[4].data.number;
|
tiles = element->params[4].data.number;
|
||||||
else
|
|
||||||
tiles = 1;
|
|
||||||
|
|
||||||
info.screen()->loadImage(id, new RBImage(filename, tiles, x, y,
|
info.screen()->loadImage(id, new RBImage(filename, tiles, x, y,
|
||||||
this, viewport));
|
this, viewport));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue