summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-07-08 08:05:07 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-07-08 08:05:07 -0500
commit1742070ba044a5fcc7195bb425295a12b729572f (patch)
tree61cc0259ae79f7040f8544083cbe796239798ffd
parentda4baf681ac6c3af1d32ee2bca7f90e85c1a108f (diff)
downloadtdemultimedia-1742070ba044a5fcc7195bb425295a12b729572f.tar.gz
tdemultimedia-1742070ba044a5fcc7195bb425295a12b729572f.zip
Fix kmix abort on startup due to oversized tray icon creation when icon widget has not yet been shown
-rw-r--r--kmix/kmixdockwidget.cpp15
-rw-r--r--kmix/kmixdockwidget.h1
2 files changed, 12 insertions, 4 deletions
diff --git a/kmix/kmixdockwidget.cpp b/kmix/kmixdockwidget.cpp
index eaaf4029..ae6bdb25 100644
--- a/kmix/kmixdockwidget.cpp
+++ b/kmix/kmixdockwidget.cpp
@@ -240,12 +240,14 @@ KMixDockWidget::updatePixmap(bool force)
TQPixmap scaledpixmap;
TQImage newIcon;
switch ( newPixmapType ) {
- case 'e': origpixmap = loadSizedIcon( "kmixdocked_error", width() ); break;
- case 'm': origpixmap = loadSizedIcon( "kmixdocked_mute" , width() ); break;
- case 'd': origpixmap = loadSizedIcon( "kmixdocked" , width() ); break;
+ case 'e': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_error", width() ) : loadIcon( "kmixdocked_error"); break;
+ case 'm': origpixmap = isShown() ? loadSizedIcon( "kmixdocked_mute" , width() ) : loadIcon( "kmixdocked_mute"); break;
+ case 'd': origpixmap = isShown() ? loadSizedIcon( "kmixdocked" , width() ) : loadIcon( "kmixdocked "); break;
}
newIcon = origpixmap;
- newIcon = newIcon.smoothScale(width(), height());
+ if (isShown()) {
+ newIcon = newIcon.smoothScale(width(), height());
+ }
scaledpixmap = newIcon;
setPixmap(scaledpixmap);
@@ -258,6 +260,11 @@ void KMixDockWidget::resizeEvent ( TQResizeEvent * )
updatePixmap(true);
}
+void KMixDockWidget::showEvent ( TQShowEvent * )
+{
+ updatePixmap(true);
+}
+
void
KMixDockWidget::mousePressEvent(TQMouseEvent *me)
{
diff --git a/kmix/kmixdockwidget.h b/kmix/kmixdockwidget.h
index 2315a087..0899d28f 100644
--- a/kmix/kmixdockwidget.h
+++ b/kmix/kmixdockwidget.h
@@ -69,6 +69,7 @@ class KMixDockWidget : public KSystemTray {
void contextMenuAboutToShow( TDEPopupMenu* menu );
void toggleMinimizeRestore();
void resizeEvent ( TQResizeEvent * );
+ void showEvent ( TQShowEvent * );
private:
bool _playBeepOnVolumeChange;