Fix 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 7badb5a24e
commit f3088bc3de

@ -55,9 +55,9 @@ Amarok::TrayIcon::TrayIcon( TQWidget *playerWidget )
quit->disconnect(); quit->disconnect();
connect( quit, TQT_SIGNAL(activated()), kapp, TQT_SLOT(quit()) ); connect( quit, TQT_SIGNAL(activated()), kapp, TQT_SLOT(quit()) );
baseIcon = KSystemTray::loadSizedIcon( "amarok", width() ); baseIcon = KSystemTray::loadIcon( "amarok" );
playOverlay = Amarok::loadOverlay( "play", width() ); playOverlay = Amarok::loadOverlay( "play", baseIcon.width() );
pauseOverlay = Amarok::loadOverlay( "pause", width() ); pauseOverlay = Amarok::loadOverlay( "pause", baseIcon.width() );
overlayVisible = false; overlayVisible = false;
//paintIcon(); //paintIcon();
@ -102,7 +102,7 @@ Amarok::TrayIcon::event( TQEvent *e )
} }
} }
void Amarok::TrayIcon::resizeEvent ( TQResizeEvent * ) void Amarok::TrayIcon::resizeTrayIcon ()
{ {
// Honor Free Desktop specifications that allow for arbitrary system tray icon sizes // Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
baseIcon = KSystemTray::loadSizedIcon( "amarok", width() ); baseIcon = KSystemTray::loadSizedIcon( "amarok", width() );
@ -121,6 +121,16 @@ void Amarok::TrayIcon::resizeEvent ( TQResizeEvent * )
paintIcon( -1, true ); paintIcon( -1, true );
} }
void Amarok::TrayIcon::resizeEvent ( TQResizeEvent * )
{
resizeTrayIcon();
}
void Amarok::TrayIcon::showEvent ( TQShowEvent * )
{
resizeTrayIcon();
}
void void
Amarok::TrayIcon::engineStateChanged( Engine::State state, Engine::State /*oldState*/ ) Amarok::TrayIcon::engineStateChanged( Engine::State state, Engine::State /*oldState*/ )
{ {

@ -31,6 +31,7 @@ protected:
// get notified of 'highlight' color change // get notified of 'highlight' color change
virtual void paletteChange( const TQPalette & oldPalette ); virtual void paletteChange( const TQPalette & oldPalette );
void resizeEvent ( TQResizeEvent * ); void resizeEvent ( TQResizeEvent * );
void showEvent ( TQShowEvent * );
private: private:
bool event( TQEvent* ); bool event( TQEvent* );
@ -40,6 +41,7 @@ private:
void paintIcon( int mergePixels = -1, bool force = false ); void paintIcon( int mergePixels = -1, bool force = false );
// blend an overlay icon over 'sourcePixmap' and repaint trayIcon // blend an overlay icon over 'sourcePixmap' and repaint trayIcon
void blendOverlay( TQPixmap &sourcePixmap ); void blendOverlay( TQPixmap &sourcePixmap );
void resizeTrayIcon();
long trackLength, mergeLevel; long trackLength, mergeLevel;
TQPixmap baseIcon, grayedIcon, alternateIcon; TQPixmap baseIcon, grayedIcon, alternateIcon;

@ -106,10 +106,13 @@
/* have mp4v2 */ /* have mp4v2 */
#undef HAVE_MP4V2 #undef HAVE_MP4V2
/* Define to 1 if you have the <mp4v2/mp4v2.h> header file. */ /* have mp4v2 h */
#undef HAVE_MP4V2_H #undef HAVE_MP4V2_H
/* Define to 1 if you have the <mp4.h> header file. */ /* Define to 1 if you have the <mp4v2/mp4v2.h> header file. */
#undef HAVE_MP4V2_MP4V2_H
/* have mp4 h */
#undef HAVE_MP4_H #undef HAVE_MP4_H
/* have NMM */ /* have NMM */
@ -399,6 +402,9 @@ int snprintf(char *str, size_t n, char const *fmt, ...);
#endif #endif
/* define to 1 if -fvisibility is supported */
#undef __KDE_HAVE_GCC_VISIBILITY
#if defined(__SVR4) && !defined(__svr4__) #if defined(__SVR4) && !defined(__svr4__)
#define __svr4__ 1 #define __svr4__ 1

Loading…
Cancel
Save