Changeset View
Changeset View
Standalone View
Standalone View
src/TerminalDisplay.cpp
Show First 20 Lines • Show All 434 Lines • ▼ Show 20 Line(s) | 395 | TerminalDisplay::TerminalDisplay(QWidget* parent) | |||
---|---|---|---|---|---|
435 | , _bellMode(Enum::NotifyBell) | 435 | , _bellMode(Enum::NotifyBell) | ||
436 | , _allowBlinkingText(true) | 436 | , _allowBlinkingText(true) | ||
437 | , _allowBlinkingCursor(false) | 437 | , _allowBlinkingCursor(false) | ||
438 | , _textBlinking(false) | 438 | , _textBlinking(false) | ||
439 | , _cursorBlinking(false) | 439 | , _cursorBlinking(false) | ||
440 | , _hasTextBlinker(false) | 440 | , _hasTextBlinker(false) | ||
441 | , _urlHintsModifiers(Qt::NoModifier) | 441 | , _urlHintsModifiers(Qt::NoModifier) | ||
442 | , _showUrlHint(false) | 442 | , _showUrlHint(false) | ||
443 | , _reverseUrlHints(false) | ||||
443 | , _openLinksByDirectClick(false) | 444 | , _openLinksByDirectClick(false) | ||
444 | , _ctrlRequiredForDrag(true) | 445 | , _ctrlRequiredForDrag(true) | ||
445 | , _dropUrlsAsText(false) | 446 | , _dropUrlsAsText(false) | ||
446 | , _tripleClickMode(Enum::SelectWholeLine) | 447 | , _tripleClickMode(Enum::SelectWholeLine) | ||
447 | , _possibleTripleClick(false) | 448 | , _possibleTripleClick(false) | ||
448 | , _resizeWidget(nullptr) | 449 | , _resizeWidget(nullptr) | ||
449 | , _resizeTimer(nullptr) | 450 | , _resizeTimer(nullptr) | ||
450 | , _flowControlWarningEnabled(false) | 451 | , _flowControlWarningEnabled(false) | ||
▲ Show 20 Lines • Show All 1087 Lines • ▼ Show 20 Line(s) | 1528 | { | |||
1538 | getCharacterPosition(cursorPos, cursorLine, cursorColumn, false); | 1539 | getCharacterPosition(cursorPos, cursorLine, cursorColumn, false); | ||
1539 | Character cursorCharacter = _image[loc(qMin(cursorColumn, _columns - 1), cursorLine)]; | 1540 | Character cursorCharacter = _image[loc(qMin(cursorColumn, _columns - 1), cursorLine)]; | ||
1540 | 1541 | | |||
1541 | painter.setPen(QPen(cursorCharacter.foregroundColor.color(colorTable()))); | 1542 | painter.setPen(QPen(cursorCharacter.foregroundColor.color(colorTable()))); | ||
1542 | 1543 | | |||
1543 | // iterate over hotspots identified by the display's currently active filters | 1544 | // iterate over hotspots identified by the display's currently active filters | ||
1544 | // and draw appropriate visuals to indicate the presence of the hotspot | 1545 | // and draw appropriate visuals to indicate the presence of the hotspot | ||
1545 | 1546 | | |||
1546 | int urlNumber = 0; | | |||
1547 | QList<Filter::HotSpot*> spots = _filterChain->hotSpots(); | 1547 | QList<Filter::HotSpot*> spots = _filterChain->hotSpots(); | ||
1548 | int urlNumber, urlNumInc; | ||||
1549 | if (_reverseUrlHints) { | ||||
1550 | urlNumber = spots.size() + 1; | ||||
1551 | urlNumInc = -1; | ||||
1552 | } else { | ||||
1553 | urlNumber = 0; | ||||
1554 | urlNumInc = 1; | ||||
1555 | } | ||||
1548 | foreach(Filter::HotSpot* spot, spots) { | 1556 | foreach(Filter::HotSpot* spot, spots) { | ||
1549 | urlNumber++; | 1557 | urlNumber += urlNumInc; | ||
1550 | 1558 | | |||
1551 | QRegion region; | 1559 | QRegion region; | ||
1552 | if (spot->type() == Filter::HotSpot::Link) { | 1560 | if (spot->type() == Filter::HotSpot::Link) { | ||
1553 | QRect r; | 1561 | QRect r; | ||
1554 | if (spot->startLine() == spot->endLine()) { | 1562 | if (spot->startLine() == spot->endLine()) { | ||
1555 | r.setCoords(spot->startColumn()*_fontWidth + _contentRect.left(), | 1563 | r.setCoords(spot->startColumn()*_fontWidth + _contentRect.left(), | ||
1556 | spot->startLine()*_fontHeight + _contentRect.top(), | 1564 | spot->startLine()*_fontHeight + _contentRect.top(), | ||
1557 | (spot->endColumn())*_fontWidth + _contentRect.left() - 1, | 1565 | (spot->endColumn())*_fontWidth + _contentRect.left() - 1, | ||
▲ Show 20 Lines • Show All 2001 Lines • ▼ Show 20 Line(s) | 3564 | { | |||
3559 | updateLineProperties(); | 3567 | updateLineProperties(); | ||
3560 | updateImage(); | 3568 | updateImage(); | ||
3561 | viewScrolledByUser(); | 3569 | viewScrolledByUser(); | ||
3562 | } | 3570 | } | ||
3563 | 3571 | | |||
3564 | void TerminalDisplay::keyPressEvent(QKeyEvent* event) | 3572 | void TerminalDisplay::keyPressEvent(QKeyEvent* event) | ||
3565 | { | 3573 | { | ||
3566 | if ((_urlHintsModifiers != 0u) && event->modifiers() == _urlHintsModifiers) { | 3574 | if ((_urlHintsModifiers != 0u) && event->modifiers() == _urlHintsModifiers) { | ||
3575 | int nHotSpots = _filterChain->hotSpots().count(); | ||||
3567 | int hintSelected = event->key() - 0x31; | 3576 | int hintSelected = event->key() - 0x31; | ||
3568 | if (hintSelected >= 0 && hintSelected < 10 && hintSelected < _filterChain->hotSpots().count()) { | 3577 | if (hintSelected >= 0 && hintSelected < 10 && hintSelected < nHotSpots) { | ||
3578 | if (_reverseUrlHints) { | ||||
3579 | hintSelected = nHotSpots - hintSelected - 1; | ||||
3580 | } | ||||
3569 | _filterChain->hotSpots().at(hintSelected)->activate(); | 3581 | _filterChain->hotSpots().at(hintSelected)->activate(); | ||
3570 | _showUrlHint = false; | 3582 | _showUrlHint = false; | ||
3571 | update(); | 3583 | update(); | ||
3572 | return; | 3584 | return; | ||
3573 | } | 3585 | } | ||
3574 | 3586 | | |||
3575 | if (!_showUrlHint) { | 3587 | if (!_showUrlHint) { | ||
3576 | processFilters(); | 3588 | processFilters(); | ||
▲ Show 20 Lines • Show All 407 Lines • Show Last 20 Lines |