summaryrefslogtreecommitdiffstats
path: root/kicker/applets/naughty/NaughtyApplet.cpp
diff options
context:
space:
mode:
authorMavridis Philippe <[email protected]>2021-07-07 13:01:30 +0300
committerMavridis Philippe <[email protected]>2021-07-07 13:01:30 +0300
commite22588e97dc93fd9b38362fede37fb23b3eb4af6 (patch)
treef6b2f8b5faca4e59182ab4a0f955e5a20c9f8d21 /kicker/applets/naughty/NaughtyApplet.cpp
parentbaf43828a306475d82638dbb415f0c98849f8241 (diff)
downloadtdebase-e22588e97dc93fd9b38362fede37fb23b3eb4af6.tar.gz
tdebase-e22588e97dc93fd9b38362fede37fb23b3eb4af6.zip
Naughty applet: dynamic applet size
This commit also replaces old 20x20 pixmap with new ones if higher quality. This solves issue #213. Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'kicker/applets/naughty/NaughtyApplet.cpp')
-rw-r--r--kicker/applets/naughty/NaughtyApplet.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/kicker/applets/naughty/NaughtyApplet.cpp b/kicker/applets/naughty/NaughtyApplet.cpp
index 1da45a350..8eb26afbc 100644
--- a/kicker/applets/naughty/NaughtyApplet.cpp
+++ b/kicker/applets/naughty/NaughtyApplet.cpp
@@ -67,7 +67,6 @@ NaughtyApplet::NaughtyApplet
setBackgroundOrigin( AncestorOrigin );
button_ = new SimpleButton(this);
- button_->setFixedSize(20, 20);
TQVBoxLayout * layout = new TQVBoxLayout(this);
layout->addWidget(button_);
@@ -132,25 +131,15 @@ NaughtyApplet::slotWarn(ulong pid, const TQString & name)
}
}
- int
-NaughtyApplet::widthForHeight(int) const
-{
- return 20;
-}
-
- int
-NaughtyApplet::heightForWidth(int) const
-{
- return 20;
-}
void
NaughtyApplet::slotLoad(uint l)
{
- if (l > monitor_->triggerLevel())
- button_->setPixmap(BarIcon("naughty-sad"));
- else
- button_->setPixmap(BarIcon("naughty-happy"));
+ button_->setPixmap(TDEGlobal::iconLoader()->loadIcon(
+ (l > monitor_->triggerLevel() ? "naughty-sad" : "naughty-happy"),
+ TDEIcon::Panel,
+ TQMIN(size().width(),size().height())-2
+ ));
}
void