[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/kicker/applets/clock
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2005-02-12 9:28:25
Message-ID: 20050212092825.0A77B1D1AC () office ! kde ! org
[Download RAW message or body]
CVS commit by aseigo:
another way to break transparency in the clock fixed.
BUG:98398
M +14 -3 clock.cpp 1.202
M +1 -0 clock.h 1.56
--- kdebase/kicker/applets/clock/clock.cpp #1.201:1.202
@@ -365,5 +365,5 @@ void DigitalClock::loadSettings()
}
-void DigitalClock::paintEvent( QPaintEvent*)
+void DigitalClock::paintEvent(QPaintEvent*)
{
QPainter p(_buffer);
@@ -373,5 +373,6 @@ void DigitalClock::paintEvent( QPaintEve
p.drawTiledPixmap(0, 0, width(), height(), lcdPattern);
}
- else if (_prefs->digitalBackgroundColor() != palette().active().background())
+ else if (_prefs->digitalBackgroundColor() !=
+ KApplication::palette().active().background())
{
p.fillRect(0, 0, width(), height(), _prefs->digitalBackgroundColor());
@@ -861,4 +862,5 @@ ClockApplet::ClockApplet(const QString&
m_layoutTimer(new QTimer(this)),
m_layoutDelay(0),
+ m_followBackgroundSetting(true),
_prefs(new Prefs(sharedConfig())),
zone(new Zone(config())),
@@ -1132,18 +1134,24 @@ void ClockApplet::reconfigure()
}
+ QColor globalBgroundColor = KApplication::palette().active().background();
+ QColor bgroundColor;
switch (_prefs->type())
{
case Prefs::EnumType::Plain:
_clock = new PlainClock(this, _prefs, this);
+ bgroundColor = _prefs->plainBackgroundColor();
break;
case Prefs::EnumType::Analog:
_clock = new AnalogClock(this, _prefs, this);
+ bgroundColor = _prefs->analogBackgroundColor();
break;
case Prefs::EnumType::Fuzzy:
_clock = new FuzzyClock(this, _prefs, this);
+ bgroundColor = _prefs->fuzzyBackgroundColor();
break;
case Prefs::EnumType::Digital:
default:
_clock = new DigitalClock(this, _prefs, this);
+ bgroundColor = _prefs->digitalBackgroundColor();
break;
}
@@ -1174,4 +1182,7 @@ void ClockApplet::reconfigure()
updateDateLabel();
+ // FIXME: this means you can't have a transparent clock but a non-transparent
+ // date or day =/
+ m_followBackgroundSetting = (bgroundColor == globalBgroundColor);
setBackground();
@@ -1211,5 +1222,5 @@ void ClockApplet::setBackground()
// if the clock has the same background color that we do,
// let's propagate the background brush too
- if (_clock->widget()->paletteBackgroundColor() == palette().active().background())
+ if (m_followBackgroundSetting)
{
_clock->widget()->setBackgroundOrigin(AncestorOrigin);
--- kdebase/kicker/applets/clock/clock.h #1.55:1.56
@@ -320,4 +320,5 @@ protected:
QTimer *m_layoutTimer;
int m_layoutDelay;
+ int m_followBackgroundSetting;
// settings
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic