Clock time doesn't show background image - bug?

Trevor Harmon trevor at vocaro.com
Mon Dec 16 06:30:22 GMT 2002


OK, I've got a patch for this bug (attached). It only fixes the Plain and 
Fuzzy clocks, however, because the Digital and Analog types have fancy custom 
drawing routines. Those will have to wait until later.

The question I have is, what are the latest rules for applying patches? (The 
delay of KDE 3.1 got me confused.) Is HEAD open for everything now, or only 
bug fixes? And can I apply a bug of this type to the KDE 3.1 branch myself (I 
have a CVS account), or does somebody else have to review it first? Or are we 
not allowing anything but showstopper fixes to the 3.1 branch? Anybody feel 
free to jump in here or point me to the right information...

Thanks,

Trevor
-------------- next part --------------
diff -uNp kdebase/kicker/applets/clock-cvs/clock.cpp kdebase/kicker/applets/clock/clock.cpp
--- kdebase/kicker/applets/clock-cvs/clock.cpp	2002-12-15 23:59:55.000000000 -0600
+++ kdebase/kicker/applets/clock/clock.cpp	2002-12-16 00:28:03.000000000 -0600
@@ -103,10 +103,14 @@ PlainClock::PlainClock(ClockApplet *appl
     setFrameStyle(Panel | (_settings->showFrame() ? Sunken : 0));
     setAlignment(AlignVCenter | AlignHCenter | WordBreak);
     setFont(_settings->font());
+    setBackgroundMode(QWidget::X11ParentRelative); // Allows background image to show through
+    
     QPalette pal = palette();
     pal.setColor( QColorGroup::Foreground, _settings->foreColor());
-    pal.setColor( QColorGroup::Background, _settings->backColor());
+    if (_settings->useCustomColors())
+        pal.setColor( QColorGroup::Background, _settings->backColor());
     setPalette( pal );
+        
     updateClock();
 }
 
@@ -500,7 +504,11 @@ FuzzyClock::FuzzyClock(ClockApplet *appl
     : QFrame(parent, name), ClockWidget(applet, settings)
 {
     setFrameStyle(Panel | (_settings->showFrame() ? Sunken : 0));
-    setBackgroundColor(_settings->backColor());
+    
+    if (_settings->useCustomColors())
+        setBackgroundColor(_settings->backColor());
+    
+    setBackgroundMode(QWidget::X11ParentRelative); // Allows background image to show through
 
     hourNames   << i18n("hour","one") << i18n("hour","two")
                 << i18n("hour","three") << i18n("hour","four") << i18n("hour","five")
Common subdirectories: kdebase/kicker/applets/clock-cvs/CVS and kdebase/kicker/applets/clock/CVS
diff -uNp kdebase/kicker/applets/clock-cvs/settings.cpp kdebase/kicker/applets/clock/settings.cpp
--- kdebase/kicker/applets/clock-cvs/settings.cpp	2002-12-15 23:59:56.000000000 -0600
+++ kdebase/kicker/applets/clock/settings.cpp	2002-12-15 23:57:24.000000000 -0600
@@ -485,6 +485,21 @@ bool ClockSettings::showFrame()
 }
 
 
+bool ClockSettings::useCustomColors()
+{
+    switch (_type) {
+        case Plain:
+            return _useColPlain;
+        case Digital:
+            return _useColDig;
+        case Analog:
+            return _useColAna;
+        default:         // fuzzy clock
+            return _useColFuz;
+    }
+}
+
+
 QColor ClockSettings::foreColor()
 {
     switch (_type) {
diff -uNp kdebase/kicker/applets/clock-cvs/settings.h kdebase/kicker/applets/clock/settings.h
--- kdebase/kicker/applets/clock-cvs/settings.h	2002-12-15 23:59:56.000000000 -0600
+++ kdebase/kicker/applets/clock/settings.h	2002-12-15 23:57:24.000000000 -0600
@@ -52,6 +52,7 @@ public:
 	bool showSeconds();
 	bool showDate();
 	bool showFrame();
+	bool useCustomColors();
 	QColor foreColor();
 	QColor shadowColor();
 	QColor backColor();


More information about the kde-core-devel mailing list