summaryrefslogtreecommitdiff
path: root/utils/themeeditor/gui/codeeditor.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-03 08:42:30 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-03 08:42:30 +0000
commita83adc7d6d0a16d08687a903da8a992e3affedcc (patch)
tree0ed81dca47756ac17bdfb9fad0e5e373d1358595 /utils/themeeditor/gui/codeeditor.cpp
parentdad9810fe5fe813c4960d8790651a5ad6adf2651 (diff)
downloadrockbox-a83adc7d6d0a16d08687a903da8a992e3affedcc.zip
rockbox-a83adc7d6d0a16d08687a903da8a992e3affedcc.tar.gz
rockbox-a83adc7d6d0a16d08687a903da8a992e3affedcc.tar.bz2
rockbox-a83adc7d6d0a16d08687a903da8a992e3affedcc.tar.xz
Theme Editor: Removed markup comments from CodeEditor files (it was originally a Nokia example, so it was marked up with comments for their documentation), implemented the beginnings of drag and drop editing. Viewports are now movable, but don't invoke code generation yet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27675 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to '')
-rw-r--r--utils/themeeditor/gui/codeeditor.cpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/utils/themeeditor/gui/codeeditor.cpp b/utils/themeeditor/gui/codeeditor.cpp
index 3858460..9a2a018 100644
--- a/utils/themeeditor/gui/codeeditor.cpp
+++ b/utils/themeeditor/gui/codeeditor.cpp
@@ -38,8 +38,6 @@
#include "codeeditor.h"
-//![constructor]
-
CodeEditor::CodeEditor(QWidget *parent)
: QPlainTextEdit(parent), completer(this)
{
@@ -58,10 +56,6 @@ CodeEditor::CodeEditor(QWidget *parent)
settings.beginGroup("CodeEditor");
}
-//![constructor]
-
-//![extraAreaWidth]
-
int CodeEditor::lineNumberAreaWidth()
{
int digits = 1;
@@ -76,19 +70,12 @@ int CodeEditor::lineNumberAreaWidth()
return space;
}
-//![extraAreaWidth]
-
-//![slotUpdateExtraAreaWidth]
void CodeEditor::updateLineNumberAreaWidth(int /* newBlockCount */)
{
setViewportMargins(lineNumberAreaWidth(), 0, 0, 0);
}
-//![slotUpdateExtraAreaWidth]
-
-//![slotUpdateRequest]
-
void CodeEditor::updateLineNumberArea(const QRect &rect, int dy)
{
if (dy)
@@ -100,8 +87,6 @@ void CodeEditor::updateLineNumberArea(const QRect &rect, int dy)
updateLineNumberAreaWidth(0);
}
-//![slotUpdateRequest]
-
void CodeEditor::cursorMoved()
{
/* Closing the completer if the cursor has moved out of its bounds */
@@ -138,8 +123,6 @@ void CodeEditor::insertTag()
completer.hide();
}
-//![resizeEvent]
-
void CodeEditor::resizeEvent(QResizeEvent *e)
{
QPlainTextEdit::resizeEvent(e);
@@ -149,8 +132,6 @@ void CodeEditor::resizeEvent(QResizeEvent *e)
lineNumberAreaWidth(), cr.height()));
}
-//![resizeEvent]
-
void CodeEditor::keyPressEvent(QKeyEvent *event)
{
@@ -256,23 +237,16 @@ void CodeEditor::keyPressEvent(QKeyEvent *event)
}
-//![extraAreaPaintEvent_0]
-
void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
{
QPainter painter(lineNumberArea);
painter.fillRect(event->rect(), Qt::lightGray);
-//![extraAreaPaintEvent_0]
-
-//![extraAreaPaintEvent_1]
QTextBlock block = firstVisibleBlock();
int blockNumber = block.blockNumber();
int top = (int) blockBoundingGeometry(block).translated(contentOffset()).top();
int bottom = top + (int) blockBoundingRect(block).height();
-//![extraAreaPaintEvent_1]
-//![extraAreaPaintEvent_2]
while (block.isValid() && top <= event->rect().bottom()) {
if (block.isVisible() && bottom >= event->rect().top()) {
QString number = QString::number(blockNumber + 1);
@@ -293,5 +267,4 @@ void CodeEditor::lineNumberAreaPaintEvent(QPaintEvent *event)
++blockNumber;
}
}
-//![extraAreaPaintEvent_2]