Changeset View
Changeset View
Standalone View
Standalone View
src/TerminalDisplay.cpp
Show First 20 Lines • Show All 1629 Lines • ▼ Show 20 Line(s) | 1612 | { | |||
---|---|---|---|---|---|
1630 | 1630 | | |||
1631 | const bool drawDimmed = _dimWhenInactive && !hasFocus(); | 1631 | const bool drawDimmed = _dimWhenInactive && !hasFocus(); | ||
1632 | const QColor dimColor(0, 0, 0, 128); | 1632 | const QColor dimColor(0, 0, 0, 128); | ||
1633 | foreach(const QRect & rect, (pe->region() & contentsRect()).rects()) { | 1633 | foreach(const QRect & rect, (pe->region() & contentsRect()).rects()) { | ||
1634 | if (drawDimmed) { | 1634 | if (drawDimmed) { | ||
1635 | paint.fillRect(rect, dimColor); | 1635 | paint.fillRect(rect, dimColor); | ||
1636 | } | 1636 | } | ||
1637 | } | 1637 | } | ||
1638 | | ||||
1639 | if (!hasFocus()) { | ||||
1640 | // black + transparency | ||||
1641 | const auto shade = QColor(0,0,0,125); | ||||
1642 | paint.setPen(shade); | ||||
1643 | paint.setBrush(QBrush(shade)); | ||||
1644 | paint.drawRect(geometry()); | ||||
1645 | } | ||||
1638 | } | 1646 | } | ||
1639 | 1647 | | |||
1640 | void TerminalDisplay::printContent(QPainter& painter, bool friendly) | 1648 | void TerminalDisplay::printContent(QPainter& painter, bool friendly) | ||
1641 | { | 1649 | { | ||
1642 | // Reinitialize the font with the printers paint device so the font | 1650 | // Reinitialize the font with the printers paint device so the font | ||
1643 | // measurement calculations will be done correctly | 1651 | // measurement calculations will be done correctly | ||
1644 | QFont savedFont = getVTFont(); | 1652 | QFont savedFont = getVTFont(); | ||
1645 | QFont font(savedFont, painter.device()); | 1653 | QFont font(savedFont, painter.device()); | ||
▲ Show 20 Lines • Show All 454 Lines • ▼ Show 20 Line(s) | 2092 | { | |||
2100 | 2108 | | |||
2101 | // suppress further text blinking | 2109 | // suppress further text blinking | ||
2102 | _blinkTextTimer->stop(); | 2110 | _blinkTextTimer->stop(); | ||
2103 | Q_ASSERT(!_textBlinking); | 2111 | Q_ASSERT(!_textBlinking); | ||
2104 | 2112 | | |||
2105 | _showUrlHint = false; | 2113 | _showUrlHint = false; | ||
2106 | 2114 | | |||
2107 | emit focusLost(); | 2115 | emit focusLost(); | ||
2116 | update(); | ||||
2108 | } | 2117 | } | ||
2109 | 2118 | | |||
2110 | void TerminalDisplay::focusInEvent(QFocusEvent*) | 2119 | void TerminalDisplay::focusInEvent(QFocusEvent*) | ||
2111 | { | 2120 | { | ||
2112 | if (_allowBlinkingCursor) { | 2121 | if (_allowBlinkingCursor) { | ||
2113 | _blinkCursorTimer->start(); | 2122 | _blinkCursorTimer->start(); | ||
2114 | } | 2123 | } | ||
2115 | 2124 | | |||
2116 | updateCursor(); | 2125 | updateCursor(); | ||
2117 | 2126 | | |||
2118 | if (_allowBlinkingText && _hasTextBlinker) { | 2127 | if (_allowBlinkingText && _hasTextBlinker) { | ||
2119 | _blinkTextTimer->start(); | 2128 | _blinkTextTimer->start(); | ||
2120 | } | 2129 | } | ||
2121 | 2130 | | |||
2122 | emit focusGained(); | 2131 | emit focusGained(); | ||
2132 | update(); | ||||
2123 | } | 2133 | } | ||
2124 | 2134 | | |||
2125 | void TerminalDisplay::blinkTextEvent() | 2135 | void TerminalDisplay::blinkTextEvent() | ||
2126 | { | 2136 | { | ||
2127 | Q_ASSERT(_allowBlinkingText); | 2137 | Q_ASSERT(_allowBlinkingText); | ||
2128 | 2138 | | |||
2129 | _textBlinking = !_textBlinking; | 2139 | _textBlinking = !_textBlinking; | ||
2130 | 2140 | | |||
▲ Show 20 Lines • Show All 2065 Lines • Show Last 20 Lines |