Commit e98a26e1 authored by Robert Knight's avatar Robert Knight
Browse files

Fill the background of the terminal display area behind the scroll-bar using...

Fill the background of the terminal display area behind the scroll-bar using the background color from the scroll-bar's palette.  This gives the illusion of the scroll bar being outside the contents area as per other KDE applications and is required for a better looking scrollbar with the Oxygen widget style.  CCMAIL:cbr@boemann.dk

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=740161
parent 2e2af2cd
......@@ -530,6 +530,18 @@ void TerminalDisplay::setOpacity(qreal opacity)
void TerminalDisplay::drawBackground(QPainter& painter, const QRect& rect, const QColor& backgroundColor)
{
// the area of the widget showing the contents of the terminal display is drawn
// using the background color from the color scheme set with setColorTable()
//
// the area of the widget behind the scroll-bar is drawn using the background
// brush from the scroll-bar's palette, to give the effect of the scroll-bar
// being outside of the terminal display and visual consistency with other KDE
// applications.
//
QRect scrollBarArea = rect.intersected(_scrollBar->geometry());
QRegion contentsRegion = QRegion(rect).subtracted(scrollBarArea);
QRect contentsRect = contentsRegion.boundingRect();
if ( HAVE_TRANSPARENCY && qAlpha(_blendColor) < 0xff )
{
QColor color(backgroundColor);
......@@ -537,11 +549,13 @@ void TerminalDisplay::drawBackground(QPainter& painter, const QRect& rect, const
painter.save();
painter.setCompositionMode(QPainter::CompositionMode_Source);
painter.fillRect(rect, color);
painter.fillRect(contentsRect, color);
painter.restore();
}
else
painter.fillRect(rect, backgroundColor);
painter.fillRect(contentsRect, backgroundColor);
painter.fillRect(scrollBarArea,_scrollBar->palette().background());
}
void TerminalDisplay::drawCursor(QPainter& painter,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment