From 513ffc6edff67b5f7f121c3064b059ce82cbb842 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 1 Jul 2012 19:12:13 -0500 Subject: Add ability to set KLed off color --- tdeui/kled.cpp | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'tdeui/kled.cpp') 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 (j.habenicht@europemail.com) + Copyright (C) 1998 J�rg Habenicht (j.habenicht@europemail.com) 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 { @@ -580,6 +586,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) { -- cgit v1.2.1