[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeaddons/kicker-applets/kbinaryclock
From: Benjamin Meyer <benjamin () csh ! rit ! edu>
Date: 2003-06-19 17:55:32
[Download RAW message or body]
CVS commit by bmeyer:
Fixed background so that in theory the backgraound in transperant
M +16 -6 kbinaryclock.cpp 1.2
--- kdeaddons/kicker-applets/kbinaryclock/kbinaryclock.cpp #1.1:1.2
@@ -110,4 +110,6 @@ void SettingsImp::updatePreview(){
}
+#include <qlabel.h>
+
/**
* Constructor, create LED's
@@ -115,6 +117,7 @@ void SettingsImp::updatePreview(){
KBinaryClock::KBinaryClock(const QString& configFile, Type type, int actions, QWidget *parent, const char *name)
: KPanelApplet(configFile, type, actions, parent, name), ledWidth(6) {
- bug = new QWidget(this, "stupid bug!");
- bug->resize(60,40);
+ bug = new QWidget(this, "this is here because of a stupid bug!");
+ bug->hide();
+ setBackgroundOrigin(AncestorOrigin);
layout = new QGridLayout( bug, 4, ledWidth, 0, 0, "Layout");
for(int i=0; i < 4; i++){
@@ -122,7 +125,9 @@ KBinaryClock::KBinaryClock(const QString
KLed *led = new KLed( this );
layout->addWidget( led, j, i );
+ led->setBackgroundOrigin(AncestorOrigin);
ledMatrix[j][i] = led;
}
}
+
loadSettings();
updateClock();
@@ -173,5 +178,9 @@ void KBinaryClock::loadSettings(){
int darkFactor = config()->readNumEntry("DarkFactor", 300);
QColor backgroundColor = config()->readColorEntry("Background", &KApplication::palette().active().background());
- setBackgroundColor(backgroundColor);
+ bool modifyBackground = false;
+ if(backgroundColor != KApplication::palette().active().background()){
+ setPaletteBackgroundColor(backgroundColor);
+ modifyBackground = true;
+ }
bool showSeconds = config()->readBoolEntry("Show_Seconds", true);
@@ -191,5 +200,6 @@ void KBinaryClock::loadSettings(){
ledMatrix[j][i]->setLook(look);
ledMatrix[j][i]->setDarkFactor(darkFactor);
- ledMatrix[j][i]->setBackgroundColor(backgroundColor);
+ if(modifyBackground)
+ ledMatrix[j][i]->setPaletteBackgroundColor(backgroundColor);
}
}
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic