diff --git a/krusader/KViewer/lister.h b/krusader/KViewer/lister.h --- a/krusader/KViewer/lister.h +++ b/krusader/KViewer/lister.h @@ -118,6 +118,7 @@ protected slots: void slotActionTriggered(int action); void slotCursorPositionChanged(); + void blinkCursor(); void zoomIn(int range = 1); void zoomOut(int range = 1); @@ -151,6 +152,8 @@ bool _inSliderOp; bool _inCursorUpdate; bool _hexMode; + + bool _cursorState = false; }; class ListerBrowserExtension : public KParts::BrowserExtension @@ -208,7 +211,6 @@ bool isSearchEnabled(); void enableSearch(bool); void enableActions(bool); - void searchDelete(); QString characterSet() { return _characterSet; @@ -229,6 +231,7 @@ } void searchNext(); void searchPrev(); + void searchDelete(); void jumpToPosition(); void saveAs(); void saveSelected(); diff --git a/krusader/KViewer/lister.cpp b/krusader/KViewer/lister.cpp --- a/krusader/KViewer/lister.cpp +++ b/krusader/KViewer/lister.cpp @@ -90,6 +90,17 @@ // zoom shortcuts connect(new QShortcut(QKeySequence("Ctrl++"), this), SIGNAL(activated()), this, SLOT(zoomIn())); connect(new QShortcut(QKeySequence("Ctrl+-"), this), SIGNAL(activated()), this, SLOT(zoomOut())); + + // start cursor blinking + QTimer *blinkTimer = new QTimer(this); + connect(blinkTimer, SIGNAL(timeout()), this, SLOT(blinkCursor())); + blinkTimer->start(500); +} + +void ListerTextArea::blinkCursor() +{ + _cursorState = !_cursorState; + setCursorWidth(_cursorState ? 2 : 0); } void ListerTextArea::reset() @@ -265,7 +276,6 @@ { _inCursorUpdate = true; if (x == -1 || y < 0) { - setCursorWidth(0); if (anchorY == -1) { _inCursorUpdate = false; return; @@ -276,8 +286,7 @@ x = (_rowContent.count() > _sizeY) ? _rowContent[ _sizeY ].length() : 0; } else x = y = 0; - } else - setCursorWidth(2); + } QTextCursor::MoveMode mode = QTextCursor::MoveAnchor; if (anchorX != -1 && anchorY != -1) { @@ -367,7 +376,6 @@ getCursorPosition(cursorX, cursorY); _cursorAtFirstColumn = (cursorX == 0); _cursorPos = textToFilePosition(cursorX, cursorY, _cursorAtFirstColumn); - setCursorWidth(2); //fprintf( stderr, "Cursor pos: %d %d %Ld\n", cursorX, cursorY, _cursorPos ); } @@ -1215,7 +1223,6 @@ _textArea = new ListerTextArea(this, widget); _textArea->setFont(QFontDatabase::systemFont(QFontDatabase::FixedFont)); _textArea->setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::TextSelectableByKeyboard); - _textArea->setCursorWidth(2); _textArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); _textArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); widget->setFocusProxy(_textArea);