From 0cc507214ab3d5c35512add1e6150c4042e0aa1c Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Tue, 8 Jun 2010 07:57:43 +0000 Subject: 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 --- utils/themeeditor/skindocument.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'utils/themeeditor/skindocument.cpp') diff --git a/utils/themeeditor/skindocument.cpp b/utils/themeeditor/skindocument.cpp index 3da248a..f7c902f 100644 --- a/utils/themeeditor/skindocument.cpp +++ b/utils/themeeditor/skindocument.cpp @@ -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); -- cgit v1.1