┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-09-22 15:12:57 +0000
committerPeter Penz <[email protected]>2008-09-22 15:12:57 +0000
commita55558a4fec730dd4d69259618e65f8bbaaedcdf (patch)
tree091d1fbb3c0162bead230f10a65f96680f104bbd /src
parentb3fa99a39c26445f4846e1d6d321186bb09b0689 (diff)
don't modify the background color to transparent, just don't draw the background if no warning is shown
CCMAIL: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=863585
Diffstat (limited to 'src')
-rw-r--r--src/statusbarmessagelabel.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/statusbarmessagelabel.cpp b/src/statusbarmessagelabel.cpp
index e24a59add..bb7c59d6a 100644
--- a/src/statusbarmessagelabel.cpp
+++ b/src/statusbarmessagelabel.cpp
@@ -43,10 +43,6 @@ StatusBarMessageLabel::StatusBarMessageLabel(QWidget* parent) :
{
setMinimumHeight(KIconLoader::SizeSmall);
- QPalette palette;
- palette.setColor(QPalette::Background, Qt::transparent);
- setPalette(palette);
-
m_timer = new QTimer(this);
connect(m_timer, SIGNAL(timeout()),
this, SLOT(timerDone()));
@@ -140,23 +136,21 @@ void StatusBarMessageLabel::paintEvent(QPaintEvent* /* event */)
{
QPainter painter(this);
- // draw background
- QColor backgroundColor = palette().window().color();
if (m_illumination > 0) {
// at this point, a: we are a second label being drawn over the already
// painted status area, so we can be translucent, and b: our palette's
// window color (bg only) seems to be wrong (always black)
KColorScheme scheme(palette().currentColorGroup(), KColorScheme::Window);
- backgroundColor = scheme.background(KColorScheme::NegativeBackground).color();
- backgroundColor.setAlpha(qMin(255, m_illumination*2));
+ QColor backgroundColor = scheme.background(KColorScheme::NegativeBackground).color();
+ backgroundColor.setAlpha(qMin(255, m_illumination * 2));
+ painter.setBrush(backgroundColor);
+ painter.setPen(Qt::NoPen);
+ painter.drawRect(QRect(0, 0, width(), height()));
}
- painter.setBrush(backgroundColor);
- painter.setPen(Qt::NoPen);
- painter.drawRect(QRect(0, 0, width(), height()));
// draw pixmap
int x = BorderGap;
- int y = (m_minTextHeight - m_pixmap.height()) / 2;
+ const int y = (m_minTextHeight - m_pixmap.height()) / 2;
if (!m_pixmap.isNull()) {
painter.drawPixmap(x, y, m_pixmap);