forked from len0rd/rockbox
Theme Editor: Stopped conditionals and sublines from triggering newlines and made combo boxes in config panel return text if not used in a conditional
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27184 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
5565a28c7d
commit
9d6b5d6317
3 changed files with 15 additions and 6 deletions
|
@ -208,6 +208,9 @@ QVariant DeviceState::data(QString tag, int paramCount,
|
|||
QPair<InputType, QWidget*> found =
|
||||
inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0));
|
||||
|
||||
if(found.second == 0 && tag[0] == '?')
|
||||
found = inputs.value(tag.right(2), QPair<InputType, QWidget*>(Slide,0));
|
||||
|
||||
if(found.second == 0)
|
||||
return QVariant();
|
||||
|
||||
|
@ -226,7 +229,10 @@ QVariant DeviceState::data(QString tag, int paramCount,
|
|||
return dynamic_cast<QDoubleSpinBox*>(found.second)->value();
|
||||
|
||||
case Combo:
|
||||
if(tag[0] == '?')
|
||||
return dynamic_cast<QComboBox*>(found.second)->currentIndex();
|
||||
else
|
||||
return dynamic_cast<QComboBox*>(found.second)->currentText();
|
||||
|
||||
case Check:
|
||||
return dynamic_cast<QCheckBox*>(found.second)->isChecked();
|
||||
|
|
|
@ -510,12 +510,14 @@ void ParseTreeNode::render(const RBRenderInfo& info)
|
|||
}
|
||||
|
||||
/* This version is called for logical lines, tags, conditionals and such */
|
||||
void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
|
||||
void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport,
|
||||
bool noBreak)
|
||||
{
|
||||
if(element->type == LINE)
|
||||
{
|
||||
for(int i = 0; i < children.count(); i++)
|
||||
children[i]->render(info, viewport);
|
||||
if(!noBreak)
|
||||
viewport->newLine();
|
||||
}
|
||||
else if(element->type == TEXT)
|
||||
|
@ -530,7 +532,7 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
|
|||
else if(element->type == CONDITIONAL)
|
||||
{
|
||||
int child = evalTag(info, true, element->children_count).toInt();
|
||||
children[child]->render(info, viewport);
|
||||
children[child]->render(info, viewport, true);
|
||||
}
|
||||
else if(element->type == SUBLINES)
|
||||
{
|
||||
|
@ -571,7 +573,7 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
|
|||
|
||||
/* ...and finally render the selected branch */
|
||||
if(branch >= 0)
|
||||
children[branch]->render(info, viewport);
|
||||
children[branch]->render(info, viewport, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,8 @@ public:
|
|||
}
|
||||
|
||||
void render(const RBRenderInfo& info);
|
||||
void render(const RBRenderInfo &info, RBViewport* viewport);
|
||||
void render(const RBRenderInfo &info, RBViewport* viewport,
|
||||
bool noBreak = false);
|
||||
|
||||
double findBranchTime(ParseTreeNode* branch, const RBRenderInfo& info);
|
||||
double findConditionalTime(ParseTreeNode* conditional,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue