summaryrefslogtreecommitdiff
path: root/utils/themeeditor/models
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-05 19:05:36 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-05 19:05:36 +0000
commitc5025c7c78b416f42f086138161d3126ad9482b9 (patch)
tree9415a0544cd17d40f21d1ae9a5599223be408fb1 /utils/themeeditor/models
parente4dc4f891393bb132927ad5d1a726f5d9429bff7 (diff)
Theme Editor: Made progress bars fully movable/savable from the preview panel
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27726 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models')
-rw-r--r--utils/themeeditor/models/parsetreenode.cpp24
-rw-r--r--utils/themeeditor/models/parsetreenode.h2
2 files changed, 21 insertions, 5 deletions
diff --git a/utils/themeeditor/models/parsetreenode.cpp b/utils/themeeditor/models/parsetreenode.cpp
index 4afd04ab9d..779d236012 100644
--- a/utils/themeeditor/models/parsetreenode.cpp
+++ b/utils/themeeditor/models/parsetreenode.cpp
@@ -682,16 +682,14 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
{
case 'b':
/* %pb */
- new RBProgressBar(viewport, info, element->params_count,
- element->params);
+ new RBProgressBar(viewport, info, this);
return true;
case 'v':
/* %pv */
if(element->params_count > 0)
{
- new RBProgressBar(viewport, info, element->params_count,
- element->params, true);
+ new RBProgressBar(viewport, info, this, true);
return true;
}
else
@@ -1075,8 +1073,24 @@ void ParseTreeNode::modParam(QVariant value, int index)
{
if(element)
{
- if(index < 0 || index >= children.count())
+ if(index < 0)
return;
+ while(index >= children.count())
+ {
+ /* Padding children with defaults until we make the necessary
+ * parameter available
+ */
+ skin_tag_parameter* newParam = new skin_tag_parameter;
+ newParam->type = skin_tag_parameter::DEFAULT;
+ /* We'll need to manually delete the extra parameters in the
+ * destructor
+ */
+ extraParams.append(children.count());
+
+ children.append(new ParseTreeNode(newParam, this, model));
+ element->params_count++;
+ }
+
children[index]->modParam(value);
}
else if(param)
diff --git a/utils/themeeditor/models/parsetreenode.h b/utils/themeeditor/models/parsetreenode.h
index 106907799e..af998faf11 100644
--- a/utils/themeeditor/models/parsetreenode.h
+++ b/utils/themeeditor/models/parsetreenode.h
@@ -88,6 +88,8 @@ private:
ParseTreeModel* model;
+ QList<int> extraParams;
+
};
#endif // PARSETREENODE_H