diff --git a/src/ScreenWindow.cpp b/src/ScreenWindow.cpp index ad0ac5f6c..31308546c 100644 --- a/src/ScreenWindow.cpp +++ b/src/ScreenWindow.cpp @@ -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) diff --git a/src/ScreenWindow.h b/src/ScreenWindow.h index d299958d9..3967d4e67 100644 --- a/src/ScreenWindow.h +++ b/src/ScreenWindow.h @@ -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. */ diff --git a/src/SessionController.cpp b/src/SessionController.cpp index 00604fdbc..0c62c9d85 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -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()) ); diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp index 4ebfada2d..d96b9f6f0 100644 --- a/src/TerminalDisplay.cpp +++ b/src/TerminalDisplay.cpp @@ -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 diff --git a/src/TerminalDisplay.h b/src/TerminalDisplay.h index dcb552e3b..2c30465fd 100644 --- a/src/TerminalDisplay.h +++ b/src/TerminalDisplay.h @@ -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(); /**