summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-11 11:52:57 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-10-11 11:52:57 -0500
commit301ec19388d7cc8e4c7897257cfbd10cb38f1679 (patch)
tree8713759702c4e2ed509c25e04d7597ebab1fda21
parent0b1f7817457c5b4a8787de496f10f5026982303a (diff)
downloadkpowersave-301ec19388d7cc8e4c7897257cfbd10cb38f1679.tar.gz
kpowersave-301ec19388d7cc8e4c7897257cfbd10cb38f1679.zip
Reload icon when tray size changes
This partially resolves Bug 1248
-rw-r--r--src/kpowersave.cpp6
-rw-r--r--src/kpowersave.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/kpowersave.cpp b/src/kpowersave.cpp
index b1c3a35..92cddc5 100644
--- a/src/kpowersave.cpp
+++ b/src/kpowersave.cpp
@@ -239,7 +239,7 @@ void kpowersave::initMenu() {
void kpowersave::resizeEvent ( TQResizeEvent * )
{
// Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
- loadIcon();
+ loadIcon(true);
drawIcon();
}
@@ -310,7 +310,7 @@ void kpowersave::showConfigureNotificationsDialog() {
* To reduce the systemload the icons are only reloaded if \ref pixmap_name
* is changed.
*/
-void kpowersave::loadIcon(){
+void kpowersave::loadIcon(bool forceReload){
kdDebugFuncIn(trace);
TQString pixmap_name_tmp = "NONE";
@@ -358,7 +358,7 @@ void kpowersave::loadIcon(){
}
// reload icon only if new icon selected
- if(pixmap_name_tmp != pixmap_name) {
+ if ((pixmap_name_tmp != pixmap_name) || (forceReload)) {
pixmap_name = pixmap_name_tmp;
if (pixmap_name.startsWith("ERROR")) {
pixmap = SmallIcon("laptoppower", width(), KIcon::DisabledState);
diff --git a/src/kpowersave.h b/src/kpowersave.h
index 6d3f124..7715392 100644
--- a/src/kpowersave.h
+++ b/src/kpowersave.h
@@ -306,7 +306,7 @@ private:
//! to intialise the menu for the kickerapplet
void initMenu();
//! load the icon for \ref redrawPixmap()
- void loadIcon();
+ void loadIcon(bool forceReload = false);
//! draw/redraw the icon for the kickerapplet
void redrawPixmap();
//! to set the screensaver settings