Changeset View
Changeset View
Standalone View
Standalone View
src/TerminalDisplay.cpp
Show First 20 Lines • Show All 805 Lines • ▼ Show 20 Line(s) | |||||
806 | { | 806 | { | ||
807 | // the area of the widget showing the contents of the terminal display is drawn | 807 | // the area of the widget showing the contents of the terminal display is drawn | ||
808 | // using the background color from the color scheme set with setColorTable() | 808 | // using the background color from the color scheme set with setColorTable() | ||
809 | // | 809 | // | ||
810 | // the area of the widget behind the scroll-bar is drawn using the background | 810 | // the area of the widget behind the scroll-bar is drawn using the background | ||
811 | // brush from the scroll-bar's palette, to give the effect of the scroll-bar | 811 | // brush from the scroll-bar's palette, to give the effect of the scroll-bar | ||
812 | // being outside of the terminal display and visual consistency with other KDE | 812 | // being outside of the terminal display and visual consistency with other KDE | ||
813 | // applications. | 813 | // applications. | ||
814 | // | | |||
815 | QRect scrollBarArea = _scrollBar->isVisible() ? | | |||
816 | rect.intersected(_scrollBar->geometry()) : | | |||
817 | QRect(); | | |||
818 | QRegion contentsRegion = QRegion(rect).subtracted(scrollBarArea); | | |||
819 | QRect contentsRect = contentsRegion.boundingRect(); | | |||
820 | 814 | | |||
821 | if (useOpacitySetting && !_wallpaper->isNull() && | 815 | if (useOpacitySetting && !_wallpaper->isNull() && | ||
822 | _wallpaper->draw(painter, contentsRect, _opacity)) { | 816 | _wallpaper->draw(painter, rect, _opacity)) { | ||
823 | } else if (qAlpha(_blendColor) < 0xff && useOpacitySetting) { | 817 | } else if (qAlpha(_blendColor) < 0xff && useOpacitySetting) { | ||
824 | #if defined(Q_OS_MACOS) | 818 | #if defined(Q_OS_MACOS) | ||
825 | // TODO - On MacOS, using CompositionMode doesn't work. Altering the | 819 | // TODO - On MacOS, using CompositionMode doesn't work. Altering the | ||
826 | // transparency in the color scheme alters the brightness. | 820 | // transparency in the color scheme alters the brightness. | ||
827 | painter.fillRect(contentsRect, backgroundColor); | 821 | painter.fillRect(rect, backgroundColor); | ||
828 | #else | 822 | #else | ||
829 | QColor color(backgroundColor); | 823 | QColor color(backgroundColor); | ||
830 | color.setAlpha(qAlpha(_blendColor)); | 824 | color.setAlpha(qAlpha(_blendColor)); | ||
831 | 825 | | |||
832 | painter.save(); | 826 | painter.save(); | ||
833 | painter.setCompositionMode(QPainter::CompositionMode_Source); | 827 | painter.setCompositionMode(QPainter::CompositionMode_Source); | ||
834 | painter.fillRect(contentsRect, color); | 828 | painter.fillRect(rect, color); | ||
835 | painter.restore(); | 829 | painter.restore(); | ||
836 | #endif | 830 | #endif | ||
837 | } else { | 831 | } else { | ||
838 | painter.fillRect(contentsRect, backgroundColor); | 832 | painter.fillRect(rect, backgroundColor); | ||
839 | } | 833 | } | ||
840 | | ||||
841 | painter.fillRect(scrollBarArea, _scrollBar->palette().background()); | | |||
842 | } | 834 | } | ||
843 | 835 | | |||
844 | void TerminalDisplay::drawCursor(QPainter& painter, | 836 | void TerminalDisplay::drawCursor(QPainter& painter, | ||
845 | const QRect& rect, | 837 | const QRect& rect, | ||
846 | const QColor& foregroundColor, | 838 | const QColor& foregroundColor, | ||
847 | const QColor& /*backgroundColor*/, | 839 | const QColor& /*backgroundColor*/, | ||
848 | bool& invertCharacterColor) | 840 | bool& invertCharacterColor) | ||
849 | { | 841 | { | ||
▲ Show 20 Lines • Show All 3010 Lines • Show Last 20 Lines |