Fix kmix abort on startup due to oversized tray icon creation when icon widget has not yet been shown

pull/1/head
Timothy Pearson 10 years ago
parent da4baf681a
commit 1742070ba0

@ -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)
{

@ -69,6 +69,7 @@ class KMixDockWidget : public KSystemTray {
void contextMenuAboutToShow( TDEPopupMenu* menu );
void toggleMinimizeRestore();
void resizeEvent ( TQResizeEvent * );
void showEvent ( TQShowEvent * );
private:
bool _playBeepOnVolumeChange;

Loading…
Cancel
Save