forked from len0rd/rockbox
Theme Editor: Beginning to work on conditional rendering, just made fix to line following code to speed up horizontal scrolling
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27168 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
aa13a5377c
commit
449a895372
8 changed files with 32 additions and 28 deletions
|
|
@ -202,7 +202,8 @@ DeviceState::~DeviceState()
|
|||
{
|
||||
}
|
||||
|
||||
QVariant DeviceState::data(QString tag)
|
||||
QVariant DeviceState::data(QString tag, int paramCount,
|
||||
skin_tag_parameter *params)
|
||||
{
|
||||
QPair<InputType, QWidget*> found =
|
||||
inputs.value(tag, QPair<InputType, QWidget*>(Slide, 0));
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
#include <QVariant>
|
||||
#include <QTabWidget>
|
||||
|
||||
#include "skin_parser.h"
|
||||
|
||||
class DeviceState : public QWidget {
|
||||
|
||||
Q_OBJECT
|
||||
|
|
@ -46,7 +48,8 @@ public:
|
|||
DeviceState(QWidget *parent = 0);
|
||||
virtual ~DeviceState();
|
||||
|
||||
QVariant data(QString tag);
|
||||
QVariant data(QString tag, int paramCount = 0,
|
||||
skin_tag_parameter* params = 0);
|
||||
void setData(QString tag, QVariant data);
|
||||
|
||||
signals:
|
||||
|
|
|
|||
|
|
@ -499,14 +499,13 @@ void EditorWindow::updateCurrent()
|
|||
|
||||
void EditorWindow::lineChanged(int line)
|
||||
{
|
||||
ui->parseTree->collapseAll();
|
||||
ParseTreeModel* model = dynamic_cast<ParseTreeModel*>
|
||||
(ui->parseTree->model());
|
||||
parseTreeSelection = new QItemSelectionModel(model);
|
||||
expandLine(model, QModelIndex(), line);
|
||||
sizeColumns();
|
||||
ui->parseTree->setSelectionModel(parseTreeSelection);
|
||||
|
||||
ui->parseTree->collapseAll();
|
||||
ParseTreeModel* model = dynamic_cast<ParseTreeModel*>
|
||||
(ui->parseTree->model());
|
||||
parseTreeSelection = new QItemSelectionModel(model);
|
||||
expandLine(model, QModelIndex(), line);
|
||||
sizeColumns();
|
||||
ui->parseTree->setSelectionModel(parseTreeSelection);
|
||||
}
|
||||
|
||||
void EditorWindow::undo()
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ SkinDocument::SkinDocument(QLabel* statusLabel, ProjectModel* project,
|
|||
saved = "";
|
||||
parseStatus = tr("Empty document");
|
||||
blockUpdate = false;
|
||||
currentLine = -1;
|
||||
}
|
||||
|
||||
SkinDocument::SkinDocument(QLabel* statusLabel, QString file,
|
||||
|
|
@ -208,8 +209,9 @@ void SkinDocument::cursorChanged()
|
|||
parseStatus = tr("Errors in document");
|
||||
statusLabel->setText(parseStatus);
|
||||
}
|
||||
else
|
||||
else if(editor->textCursor().blockNumber() != currentLine)
|
||||
{
|
||||
currentLine = editor->textCursor().blockNumber();
|
||||
emit lineChanged(editor->textCursor().blockNumber() + 1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ private:
|
|||
QString fileName;
|
||||
QString saved;
|
||||
QString parseStatus;
|
||||
int currentLine;
|
||||
|
||||
QLayout* layout;
|
||||
CodeEditor* editor;
|
||||
|
|
|
|||
|
|
@ -19,18 +19,10 @@
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include "skin_parser.h"
|
||||
#include "skin_debug.h"
|
||||
#include "editorwindow.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
|
||||
#include "parsetreemodel.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
|
|
|||
|
|
@ -509,7 +509,7 @@ void ParseTreeNode::render(const RBRenderInfo& info)
|
|||
|
||||
}
|
||||
|
||||
/* This version is called for logical lines and such */
|
||||
/* This version is called for logical lines, tags, conditionals and such */
|
||||
void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
|
||||
{
|
||||
if(element->type == LINE)
|
||||
|
|
@ -524,10 +524,13 @@ void ParseTreeNode::render(const RBRenderInfo &info, RBViewport* viewport)
|
|||
}
|
||||
else if(element->type == TAG)
|
||||
{
|
||||
|
||||
if(!execTag(info, viewport))
|
||||
viewport->write(evalTag(info).toString());
|
||||
|
||||
}
|
||||
else if(element->type == CONDITIONAL)
|
||||
{
|
||||
int child = evalTag(info, true, element->children_count).toInt();
|
||||
//children[0]->render(info, viewport);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@
|
|||
#
|
||||
# Blank lines are ignored
|
||||
#
|
||||
# A ? at the beginning of a field indicates that it's a special value for
|
||||
# conditionals
|
||||
#
|
||||
# Be warned: because this file is compiled into the application, I'm not
|
||||
# performing much of any error checking on it: screwing up the syntax may very
|
||||
# well segfault the application on startup
|
||||
|
|
@ -100,14 +103,14 @@ pr ; Time Remaining ; text ; 2:00
|
|||
ps ; Shuffle ; check ; true
|
||||
pt ; Total Track Time ; text ; 3:00
|
||||
pv ; Current Volume (dB) ; spin(-100,100) ; 0
|
||||
$pv ; Current Volume (Conditional) ; combo(Mute, Below 0 dB, 0 dB, Above 0 dB) ; 0 dB
|
||||
?pv ; Current Volume (Conditional) ; combo(Mute, Below 0 dB, 0 dB, Above 0 dB) ; 0 dB
|
||||
pS ; Track Starting ; check ; true
|
||||
pE ; Track Ending ; check ; false
|
||||
Sp ; Playback Pitch ; fspin(50,200) ; 100
|
||||
rp ; Song Playcount ; spin(0,10000) ; 20
|
||||
rr ; Song Rating ; spin(0,10) ; 5
|
||||
ra ; Autoscore ; spin(0,10) ; 7
|
||||
$C ; Album Art Available ; check ; true
|
||||
?C ; Album Art Available ; check ; true
|
||||
|
||||
[Hardware Status]
|
||||
bl ; Battery Level (-1 for unknown) ; spin(-1,100) ; 50
|
||||
|
|
@ -122,7 +125,7 @@ lh ; Hard Disk Activity ; check ; true
|
|||
|
||||
[Playback Status]
|
||||
rg ; Replaygain Value (dB) ; fspin(-100,20) ; 0
|
||||
$rg ; Replaygain Status (Conditional) ; combo(Off, Track, Album, TrackShuffle, AlbumShuffle, No Tag) ; Off
|
||||
?rg ; Replaygain Status (Conditional) ; combo(Off, Track, Album, TrackShuffle, AlbumShuffle, No Tag) ; Off
|
||||
mm ; Repeat Mode ; combo(Off, All, One, Shuffle, A-B) ; All
|
||||
mp ; Playback Mode ; combo(Stop, Play, Pause, Fast Forward, Rewind, Recording, Recording Paused, FM Radio Playing, FM Radio Muted) ; Play
|
||||
xf ; Crossfade Type ; combo(Off, Automatic Track Skip Only, Shuffle, Shuffle or Manual Track Skip, Always) ; Always
|
||||
|
|
@ -137,7 +140,7 @@ ck ; 24h Hour (No Padding) ; text ; 9
|
|||
cI ; 12h Hour ; text ; 09
|
||||
cl ; 12h Hour (No Padding) ; text ; 9
|
||||
cm ; Month (Padded) ; text ; 03
|
||||
$cm ; Month (Conditional) ; combo(January, February, March, April, May, Jun, July, August, September, October, November, December) ; January
|
||||
?cm ; Month (Conditional) ; combo(January, February, March, April, May, Jun, July, August, September, October, November, December) ; January
|
||||
cM ; Minute (Padded) ; text ; 29
|
||||
cS ; Second (Padded) ; text ; 50
|
||||
cy ; Last Two Digits of Year (Padded) ; text ; 09
|
||||
|
|
@ -147,9 +150,9 @@ cp ; Lowercase AM or PM ; combo(am,pm) ; am
|
|||
ca ; Abbreviated Weekday Name ; combo(Sun, Mon, Tue, Thu, Fri, Sat); Tue
|
||||
cb ; Abbreviated Month Name ; combo(Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) ; Jan
|
||||
cu ; Day of Week (1..7, 1 is Monday) ; spin(1,7) ; 2
|
||||
$cu ; Day of Week (Monday First, Conditional) ; combo(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday
|
||||
?cu ; Day of Week (Monday First, Conditional) ; combo(Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday
|
||||
cw ; Day of Week (0..6, 0 is Sunday) ; spin(0,6) ; 2
|
||||
$cw ; Day of Week (Sunday First, Conditional) ; combo(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday
|
||||
?cw ; Day of Week (Sunday First, Conditional) ; combo(Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday) ; Tuesday
|
||||
|
||||
[Recording Status]
|
||||
Rp ; Target Has Recorder ; check ; false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue