Theme Editor: Added line numbering in the text editor, thanks to some code from Nokia. Also made newly opened documents scroll to the top of the document after loading

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26683 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Robert Bieber 2010-06-08 07:57:43 +00:00
parent fa99c614b9
commit 0cc507214a
5 changed files with 250 additions and 5 deletions

View file

@ -52,6 +52,7 @@ SkinDocument::SkinDocument(QLabel* statusLabel, QString file, QWidget *parent):
fin.open(QFile::ReadOnly);
editor->document()->setPlainText(QString(fin.readAll()));
saved = editor->document()->toPlainText();
editor->setTextCursor(QTextCursor(editor->document()->begin()));
fin.close();
}
@ -113,7 +114,7 @@ void SkinDocument::setupUI()
{
/* Setting up the text edit */
layout = new QHBoxLayout;
editor = new QPlainTextEdit(this);
editor = new CodeEditor(this);
editor->setLineWrapMode(QPlainTextEdit::NoWrap);
layout->addWidget(editor);