summaryrefslogtreecommitdiffstats
path: root/tdeui/kled.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-07-01 19:12:13 -0500
committerTimothy Pearson <[email protected]>2012-07-01 19:12:13 -0500
commit513ffc6edff67b5f7f121c3064b059ce82cbb842 (patch)
tree21f144c87ddbde85964e075ffa9d53feca37d961 /tdeui/kled.cpp
parente202ca79c3b3f989d7b0c4be4bb96b38e7924a9a (diff)
downloadtdelibs-513ffc6edff67b5f7f121c3064b059ce82cbb842.tar.gz
tdelibs-513ffc6edff67b5f7f121c3064b059ce82cbb842.zip
Add ability to set KLed off color
Diffstat (limited to 'tdeui/kled.cpp')
-rw-r--r--tdeui/kled.cpp29
1 files changed, 23 insertions, 6 deletions
diff --git a/tdeui/kled.cpp b/tdeui/kled.cpp
index 3a3aa2a83..dc245cd6f 100644
--- a/tdeui/kled.cpp
+++ b/tdeui/kled.cpp
@@ -1,5 +1,5 @@
/* This file is part of the KDE libraries
- Copyright (C) 1998 J�rg Habenicht ([email protected])
+ Copyright (C) 1998 J�rg Habenicht ([email protected])
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -288,7 +288,7 @@ KLed::paintRound() // paint a ROUND RAISED led lamp
paint.drawEllipse( scale, scale, width - scale*2, width - scale*2 );
// Draw the bright light spot of the LED now, using modified "old"
- // painter routine taken from TDEUI�s KLed widget:
+ // painter routine taken from TDEUI�s KLed widget:
// Setting the new width of the pen is essential to avoid "pixelized"
// shadow like it can be observed with the old LED code
@@ -300,7 +300,7 @@ KLed::paintRound() // paint a ROUND RAISED led lamp
light_width *= 2;
light_width /= 3;
- // Calculate the LED�s "light factor":
+ // Calculate the LED�s "light factor":
int light_quote = (130*2/(light_width?light_width:1))+100;
// Now draw the bright spot on the LED:
@@ -384,7 +384,7 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp
paint.drawEllipse( scale, scale, width - scale*2, width - scale*2 );
// Draw the bright light spot of the LED now, using modified "old"
- // painter routine taken from TDEUI�s KLed widget:
+ // painter routine taken from TDEUI�s KLed widget:
// Setting the new width of the pen is essential to avoid "pixelized"
// shadow like it can be observed with the old LED code
@@ -396,7 +396,7 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp
light_width *= 2;
light_width /= 3;
- // Calculate the LED�s "light factor":
+ // Calculate the LED�s "light factor":
int light_quote = (130*2/(light_width?light_width:1))+100;
// Now draw the bright spot on the LED:
@@ -425,7 +425,7 @@ KLed::paintSunken() // paint a ROUND SUNKEN led lamp
paint.setBrush( brush ); // This avoids filling of the ellipse
// Set the initial color value to colorGroup().light() (bright) and start
- // drawing the shadow border at 45� (45*16 = 720).
+ // drawing the shadow border at 45� (45*16 = 720).
int angle = -720;
color = colorGroup().light();
@@ -536,6 +536,12 @@ KLed::color() const
return led_color;
}
+TQColor
+KLed::offColor() const
+{
+ return led_off_color;
+}
+
KLed::Look
KLed::look() const
{
@@ -581,6 +587,17 @@ KLed::setColor(const TQColor& col)
}
void
+KLed::setOffColor(const TQColor& col)
+{
+ if(led_off_color!=col) {
+ if(d->on_map) { delete d->on_map; d->on_map = 0; }
+ if(d->off_map) { delete d->off_map; d->off_map = 0; }
+ d->offcolor = col;
+ update();
+ }
+}
+
+void
KLed::setDarkFactor(int darkfactor)
{
if (d->dark_factor != darkfactor) {