Commit 73df051e authored by Robert Knight's avatar Robert Knight
Browse files

Fix URL filters not being updated when scrolling the display. Fix URLs being...

Fix URL filters not being updated when scrolling the display.  Fix URLs being left underlined when moving mouse outside of target area.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=665822
parent 04069377
......@@ -152,6 +152,8 @@ void ScreenWindow::scrollTo( int line )
// keep track of number of lines scrolled by,
// this can be reset by calling resetScrollCount()
_scrollCount += delta;
emit scrolled(_currentLine);
}
void ScreenWindow::setTrackOutput(bool trackOutput)
......
......@@ -196,6 +196,13 @@ signals:
*/
void outputChanged();
/**
* Emitted when the screen window is scrolled to a different position.
*
* @param line The line which is now at the top of the window.
*/
void scrolled(int line);
/**
* Emitted when the selection is changed.
*/
......
......@@ -278,6 +278,8 @@ bool SessionController::eventFilter(QObject* watched , QEvent* event)
{
qDebug() << __FUNCTION__ << "Creating url filter";
connect( _view->screenWindow() , SIGNAL(scrolled(int)) , this ,
SLOT(requireUrlFilterUpdate()) );
connect( _view->screenWindow() , SIGNAL(outputChanged()) , this ,
SLOT(requireUrlFilterUpdate()) );
......
......@@ -1499,8 +1499,13 @@ void TerminalDisplay::paintFilters(QPainter& painter)
// the right and bottom so that
// we do not overdraw adjacent
// hotspots
//
// subtracting one pixel from all sides also prevents an edge case where
// moving the mouse outside a link could still leave it underlined
// because the check below for the position of the cursor
// finds it on the border of the target area
QRect r;
r.setCoords( startColumn*_fontWidth , line*_fontHeight,
r.setCoords( startColumn*_fontWidth + 1, line*_fontHeight + 1,
endColumn*_fontWidth - 1, (line+1)*_fontHeight - 1 );
// Links need to be underlined
......
......@@ -73,8 +73,6 @@ public:
TerminalDisplay(QWidget *parent=0);
virtual ~TerminalDisplay();
void setBlendColor(const QRgb color) { _blendColor = color; }
/** Sets the default background color for the display. */
void setDefaultBackColor(const QColor& color);
/** Returns the default background color for the display */
......@@ -245,6 +243,8 @@ public:
void setSize(int cols, int lins);
void setFixedSize(int cols, int lins);
// reimplemented
QSize sizeHint() const;
/**
......@@ -320,10 +320,18 @@ public:
*/
void setVTFont(const QFont& font);
/**
* Specified whether anti-aliasing of text in the terminal display
* is enabled or not. Defaults to enabled.
*/
static void setAntialias( bool enable ) { s_antialias = enable; }
/**
* Returns true if anti-aliasing of text in the terminal is enabled.
*/
static bool antialias() { return s_antialias; }
static void setStandalone( bool standalone ) { s_standalone = standalone; }
static bool standalone() { return s_standalone; }
static bool standalone() { return s_standalone; }
/**
* Sets whether or not the current height and width of the
......@@ -336,7 +344,7 @@ public:
* the terminal in lines and columns is displayed whilst the widget
* is being resized.
*/
bool isTerminalSizeHint() { return _terminalSizeHint; }
bool terminalSizeHint() { return _terminalSizeHint; }
/**
* Sets whether the terminal size display is shown briefly
* after the widget is first shown.
......@@ -350,7 +358,11 @@ public:
void print(QPainter &paint, bool friendly, bool exact);
void setRim(int rim) { _rimX=rim; _rimY=rim; }
/**
* Sets the margin between the top-left edge of the terminal display
* and the rendered text.
*/
void setTopLeftContentsMargin(int rim) { _rimX=rim; _rimY=rim; }
/**
* Sets the terminal screen section which is displayed in this widget.
......@@ -378,8 +390,18 @@ public Q_SLOTS:
void updateLineProperties();
void setSelectionEnd();
/** Copies the selected text to the clipboard. */
void copyClipboard();
/**
* Pastes the content of the clipboard into the
* display.
*/
void pasteClipboard();
/**
* Pastes the content of the selection into the
* display.
*/
void pasteSelection();
void onClearSelection();
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment