Changeset View
Changeset View
Standalone View
Standalone View
src/TerminalDisplay.cpp
Show First 20 Lines • Show All 366 Lines • ▼ Show 20 Line(s) | 352 | TerminalDisplay::TerminalDisplay(QWidget* parent) | |||
---|---|---|---|---|---|
367 | , _image(nullptr) | 367 | , _image(nullptr) | ||
368 | , _imageSize(0) | 368 | , _imageSize(0) | ||
369 | , _lineProperties(QVector<LineProperty>()) | 369 | , _lineProperties(QVector<LineProperty>()) | ||
370 | , _randomSeed(0) | 370 | , _randomSeed(0) | ||
371 | , _resizing(false) | 371 | , _resizing(false) | ||
372 | , _showTerminalSizeHint(true) | 372 | , _showTerminalSizeHint(true) | ||
373 | , _bidiEnabled(false) | 373 | , _bidiEnabled(false) | ||
374 | , _mouseMarks(false) | 374 | , _mouseMarks(false) | ||
375 | , _alternateScrolling(true) | ||||
375 | , _isPrimaryScreen(true) | 376 | , _isPrimaryScreen(true) | ||
376 | , _bracketedPasteMode(false) | 377 | , _bracketedPasteMode(false) | ||
377 | , _iPntSel(QPoint()) | 378 | , _iPntSel(QPoint()) | ||
378 | , _pntSel(QPoint()) | 379 | , _pntSel(QPoint()) | ||
379 | , _tripleSelBegin(QPoint()) | 380 | , _tripleSelBegin(QPoint()) | ||
380 | , _actSel(0) | 381 | , _actSel(0) | ||
381 | , _wordSelectionMode(false) | 382 | , _wordSelectionMode(false) | ||
382 | , _lineSelectionMode(false) | 383 | , _lineSelectionMode(false) | ||
▲ Show 20 Lines • Show All 2392 Lines • ▼ Show 20 Line(s) | 2772 | } else if (_mouseMarks && (_scrollBar->maximum() > 0)) { | |||
2775 | _scrollWheelState.addWheelEvent(ev); | 2776 | _scrollWheelState.addWheelEvent(ev); | ||
2776 | 2777 | | |||
2777 | _scrollBar->event(ev); | 2778 | _scrollBar->event(ev); | ||
2778 | _sessionController->setSearchStartToWindowCurrentLine(); | 2779 | _sessionController->setSearchStartToWindowCurrentLine(); | ||
2779 | _scrollWheelState.clearAll(); | 2780 | _scrollWheelState.clearAll(); | ||
2780 | } else if (!_readOnly) { | 2781 | } else if (!_readOnly) { | ||
2781 | _scrollWheelState.addWheelEvent(ev); | 2782 | _scrollWheelState.addWheelEvent(ev); | ||
2782 | 2783 | | |||
2783 | if(_mouseMarks && !_isPrimaryScreen) { | 2784 | if(_mouseMarks && !_isPrimaryScreen && _alternateScrolling) { | ||
2784 | // Send simulated up / down key presses to the terminal program | 2785 | // Send simulated up / down key presses to the terminal program | ||
2785 | // for the benefit of programs such as 'less' (which use the alternate screen) | 2786 | // for the benefit of programs such as 'less' (which use the alternate screen) | ||
2786 | 2787 | | |||
2787 | // assume that each Up / Down key event will cause the terminal application | 2788 | // assume that each Up / Down key event will cause the terminal application | ||
2788 | // to scroll by one line. | 2789 | // to scroll by one line. | ||
2789 | // | 2790 | // | ||
2790 | // to get a reasonable scrolling speed, scroll by one line for every 5 degrees | 2791 | // to get a reasonable scrolling speed, scroll by one line for every 5 degrees | ||
2791 | // of mouse wheel rotation. Mouse wheels typically move in steps of 15 degrees, | 2792 | // of mouse wheel rotation. Mouse wheels typically move in steps of 15 degrees, | ||
▲ Show 20 Lines • Show All 350 Lines • ▼ Show 20 Line(s) | 3142 | { | |||
3142 | _mouseMarks = on; | 3143 | _mouseMarks = on; | ||
3143 | setCursor(_mouseMarks ? Qt::IBeamCursor : Qt::ArrowCursor); | 3144 | setCursor(_mouseMarks ? Qt::IBeamCursor : Qt::ArrowCursor); | ||
3144 | } | 3145 | } | ||
3145 | bool TerminalDisplay::usesMouse() const | 3146 | bool TerminalDisplay::usesMouse() const | ||
3146 | { | 3147 | { | ||
3147 | return _mouseMarks; | 3148 | return _mouseMarks; | ||
3148 | } | 3149 | } | ||
3149 | 3150 | | |||
3151 | void TerminalDisplay::setAlternateScrolling(bool enable) | ||||
3152 | { | ||||
3153 | _alternateScrolling = enable; | ||||
3154 | } | ||||
3155 | bool TerminalDisplay::alternateScrolling() const | ||||
3156 | { | ||||
3157 | return _alternateScrolling; | ||||
3158 | } | ||||
3150 | 3159 | | |||
3151 | void TerminalDisplay::usingPrimaryScreen(bool use) | 3160 | void TerminalDisplay::usingPrimaryScreen(bool use) | ||
3152 | { | 3161 | { | ||
3153 | _isPrimaryScreen = use; | 3162 | _isPrimaryScreen = use; | ||
3154 | } | 3163 | } | ||
3155 | 3164 | | |||
3156 | void TerminalDisplay::setBracketedPasteMode(bool on) | 3165 | void TerminalDisplay::setBracketedPasteMode(bool on) | ||
3157 | { | 3166 | { | ||
▲ Show 20 Lines • Show All 711 Lines • Show Last 20 Lines |