summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-29 06:14:36 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-29 06:14:36 +0000
commit449a895372354f8c9abeec28a147f6b88d53a269 (patch)
treea158ecad4d7aefe397601e6c3b10f9330c04da7d /utils/themeeditor/gui
parentaa13a5377ce4b982110fc44f2f9a6636d81e8d8d (diff)
downloadrockbox-449a895372354f8c9abeec28a147f6b88d53a269.zip
rockbox-449a895372354f8c9abeec28a147f6b88d53a269.tar.gz
rockbox-449a895372354f8c9abeec28a147f6b88d53a269.tar.bz2
rockbox-449a895372354f8c9abeec28a147f6b88d53a269.tar.xz
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
Diffstat (limited to 'utils/themeeditor/gui')
-rw-r--r--utils/themeeditor/gui/devicestate.cpp3
-rw-r--r--utils/themeeditor/gui/devicestate.h5
-rw-r--r--utils/themeeditor/gui/editorwindow.cpp15
-rw-r--r--utils/themeeditor/gui/skindocument.cpp4
-rw-r--r--utils/themeeditor/gui/skindocument.h1
5 files changed, 17 insertions, 11 deletions
diff --git a/utils/themeeditor/gui/devicestate.cpp b/utils/themeeditor/gui/devicestate.cpp
index 80efd4d..f4907e1 100644
--- a/utils/themeeditor/gui/devicestate.cpp
+++ b/utils/themeeditor/gui/devicestate.cpp
@@ -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));
diff --git a/utils/themeeditor/gui/devicestate.h b/utils/themeeditor/gui/devicestate.h
index cae3cef..d3a6c46 100644
--- a/utils/themeeditor/gui/devicestate.h
+++ b/utils/themeeditor/gui/devicestate.h
@@ -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:
diff --git a/utils/themeeditor/gui/editorwindow.cpp b/utils/themeeditor/gui/editorwindow.cpp
index ea6c91f..96f8552 100644
--- a/utils/themeeditor/gui/editorwindow.cpp
+++ b/utils/themeeditor/gui/editorwindow.cpp
@@ -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()
diff --git a/utils/themeeditor/gui/skindocument.cpp b/utils/themeeditor/gui/skindocument.cpp
index f8206e1..28e5297 100644
--- a/utils/themeeditor/gui/skindocument.cpp
+++ b/utils/themeeditor/gui/skindocument.cpp
@@ -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);
}
diff --git a/utils/themeeditor/gui/skindocument.h b/utils/themeeditor/gui/skindocument.h
index 1713023..7563b3c 100644
--- a/utils/themeeditor/gui/skindocument.h
+++ b/utils/themeeditor/gui/skindocument.h
@@ -97,6 +97,7 @@ private:
QString fileName;
QString saved;
QString parseStatus;
+ int currentLine;
QLayout* layout;
CodeEditor* editor;