diff options
author | Ken Moore <ken@pcbsd.org> | 2016-09-12 10:47:47 -0400 |
---|---|---|
committer | Ken Moore <ken@pcbsd.org> | 2016-09-12 10:47:47 -0400 |
commit | 11f26a3cb825823f2e89b2b3d2a5a1a34965d73e (patch) | |
tree | 548315c7ab55de2b984e206ffb0291efa032ccd6 /src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp | |
parent | Add a font selector option to LTE, so monospaced fonts can be used as needed ... (diff) | |
download | lumina-11f26a3cb825823f2e89b2b3d2a5a1a34965d73e.tar.gz lumina-11f26a3cb825823f2e89b2b3d2a5a1a34965d73e.tar.bz2 lumina-11f26a3cb825823f2e89b2b3d2a5a1a34965d73e.zip |
Add status tips for the cursor position.
Now you can see which column the cursor is on if the user needs to keep under a particular number.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp')
-rw-r--r-- | src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp index d79bdc5f..99a0ed75 100644 --- a/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp +++ b/src-qt5/desktop-utils/lumina-textedit/PlainTextEditor.cpp @@ -35,6 +35,7 @@ PlainTextEditor::PlainTextEditor(QSettings *set, QWidget *parent) : QPlainTextEd connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(LNW_highlightLine()) ); connect(this, SIGNAL(updateRequest(const QRect&, int)), this, SLOT(LNW_update(const QRect&, int)) ); connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(checkMatchChar()) ); + connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(cursorMoved()) ); connect(this, SIGNAL(textChanged()), this, SLOT(textChanged()) ); connect(watcher, SIGNAL(fileChanged(const QString&)), this, SLOT(fileChanged()) ); LNW_updateWidth(); @@ -282,6 +283,14 @@ void PlainTextEditor::textChanged(){ else{ emit FileLoaded(this->whatsThis()); } } +void PlainTextEditor::cursorMoved(){ + //Update the status tip for the editor to show the row/column number for the cursor + QTextCursor cur = this->textCursor(); + QString stat = tr("Row Number: %1, Column Number: %2"); + this->setStatusTip(stat.arg(QString::number(cur.blockNumber()+1) , QString::number(cur.columnNumber()) ) ); + emit statusTipChanged(); +} + //Function for prompting the user if the file changed externally void PlainTextEditor::fileChanged(){ qDebug() << "File Changed:" << currentFile(); |