diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-11 11:53:34 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-10-11 11:53:34 -0500 |
commit | ea31ec697bdb9d548de7e027099c128c59dadca6 (patch) | |
tree | 02703d747e58372140017daf164512fd95ddc939 | |
parent | 989ae9f31b5497c833152fe2af55df23695e0b1f (diff) | |
download | tdepowersave-ea31ec697bdb9d548de7e027099c128c59dadca6.tar.gz tdepowersave-ea31ec697bdb9d548de7e027099c128c59dadca6.zip |
Reload icon when tray size changes
This partially resolves Bug 1248
-rw-r--r-- | src/kpowersave.cpp | 6 | ||||
-rw-r--r-- | src/kpowersave.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/kpowersave.cpp b/src/kpowersave.cpp index 3f19e22..85a9440 100644 --- a/src/kpowersave.cpp +++ b/src/kpowersave.cpp @@ -233,7 +233,7 @@ void kpowersave::initMenu() { void kpowersave::resizeEvent ( TQResizeEvent * ) { // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes - loadIcon(); + loadIcon(true); drawIcon(); } @@ -304,7 +304,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"; @@ -352,7 +352,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 574d5c8..eed1927 100644 --- a/src/kpowersave.h +++ b/src/kpowersave.h @@ -285,7 +285,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 |