summaryrefslogtreecommitdiffstats
path: root/kteatime/toplevel.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2014-07-08 08:21:31 -0500
committerTimothy Pearson <[email protected]>2014-07-08 08:21:31 -0500
commitda2a24089061c8dd04f718ec5a5294b4a85276db (patch)
tree16fae1ac8c620f596d0387839f4aa89ad030822e /kteatime/toplevel.cpp
parent98d74ed28d210ff107acdc6cf42848540a0eb8e1 (diff)
downloadtdetoys-da2a24089061c8dd04f718ec5a5294b4a85276db.tar.gz
tdetoys-da2a24089061c8dd04f718ec5a5294b4a85276db.zip
Avoid excessively long startup time due to oversized tray icon creation when icon widget has not yet been shown
Diffstat (limited to 'kteatime/toplevel.cpp')
-rw-r--r--kteatime/toplevel.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/kteatime/toplevel.cpp b/kteatime/toplevel.cpp
index 6b43fa4..1980eb3 100644
--- a/kteatime/toplevel.cpp
+++ b/kteatime/toplevel.cpp
@@ -171,10 +171,10 @@ TopLevel::TopLevel() : KSystemTray()
action = config->readEntry("Action");
useTrayVis = config->readBoolEntry("UseTrayVis", true);
- mugPixmap = loadSizedIcon("mug", width());
- teaNotReadyPixmap = loadSizedIcon("tea_not_ready", width());
- teaAnim1Pixmap = loadSizedIcon("tea_anim1", width());
- teaAnim2Pixmap = loadSizedIcon("tea_anim2", width());
+ mugPixmap = loadIcon("mug");
+ teaNotReadyPixmap = loadIcon("tea_not_ready");
+ teaAnim1Pixmap = loadIcon("tea_anim1");
+ teaAnim2Pixmap = loadIcon("tea_anim2");
confdlg = 0L;
anondlg = 0L;
@@ -201,8 +201,8 @@ TopLevel::~TopLevel()
// FIXME: must delete more (like all the TQWidgets in config-window)?
}
-void TopLevel::resizeEvent ( TQResizeEvent * )
-{
+void TopLevel::resizeTrayIcon () {
+ // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
mugPixmap = loadSizedIcon("mug", width());
teaNotReadyPixmap = loadSizedIcon("tea_not_ready", width());
teaAnim1Pixmap = loadSizedIcon("tea_anim1", width());
@@ -210,6 +210,18 @@ void TopLevel::resizeEvent ( TQResizeEvent * )
repaint();
}
+void TopLevel::resizeEvent ( TQResizeEvent * )
+{
+ // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
+ resizeTrayIcon();
+}
+
+void TopLevel::showEvent ( TQShowEvent * )
+{
+ // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
+ resizeTrayIcon();
+}
+
/** Handle mousePressEvent */
void TopLevel::mousePressEvent(TQMouseEvent *event)
{