Browse Source

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

tags/r14.0.0
Timothy Pearson 5 years ago
parent
commit
f3088bc3de
3 changed files with 24 additions and 6 deletions
  1. 14
    4
      amarok/src/systray.cpp
  2. 2
    0
      amarok/src/systray.h
  3. 8
    2
      config.h.in

+ 14
- 4
amarok/src/systray.cpp View File

@@ -55,9 +55,9 @@ Amarok::TrayIcon::TrayIcon( TQWidget *playerWidget )
55 55
     quit->disconnect();
56 56
     connect( quit, TQT_SIGNAL(activated()), kapp, TQT_SLOT(quit()) );
57 57
 
58
-    baseIcon     = KSystemTray::loadSizedIcon( "amarok", width() );
59
-    playOverlay  = Amarok::loadOverlay( "play", width() );
60
-    pauseOverlay = Amarok::loadOverlay( "pause", width() );
58
+    baseIcon     = KSystemTray::loadIcon( "amarok" );
59
+    playOverlay  = Amarok::loadOverlay( "play", baseIcon.width() );
60
+    pauseOverlay = Amarok::loadOverlay( "pause", baseIcon.width() );
61 61
     overlayVisible = false;
62 62
 
63 63
     //paintIcon();
@@ -102,7 +102,7 @@ Amarok::TrayIcon::event( TQEvent *e )
102 102
     }
103 103
 }
104 104
 
105
-void Amarok::TrayIcon::resizeEvent ( TQResizeEvent * )
105
+void Amarok::TrayIcon::resizeTrayIcon ()
106 106
 {
107 107
 	// Honor Free Desktop specifications that allow for arbitrary system tray icon sizes
108 108
 	baseIcon = KSystemTray::loadSizedIcon( "amarok", width() );
@@ -121,6 +121,16 @@ void Amarok::TrayIcon::resizeEvent ( TQResizeEvent * )
121 121
 	paintIcon( -1, true );
122 122
 }
123 123
 
124
+void Amarok::TrayIcon::resizeEvent ( TQResizeEvent * )
125
+{
126
+	resizeTrayIcon();
127
+}
128
+
129
+void Amarok::TrayIcon::showEvent ( TQShowEvent * )
130
+{
131
+	resizeTrayIcon();
132
+}
133
+
124 134
 void
125 135
 Amarok::TrayIcon::engineStateChanged( Engine::State state, Engine::State /*oldState*/ )
126 136
 {

+ 2
- 0
amarok/src/systray.h View File

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

+ 8
- 2
config.h.in View File

@@ -106,10 +106,13 @@
106 106
 /* have mp4v2 */
107 107
 #undef HAVE_MP4V2
108 108
 
109
-/* Define to 1 if you have the <mp4v2/mp4v2.h> header file. */
109
+/* have mp4v2 h */
110 110
 #undef HAVE_MP4V2_H
111 111
 
112
-/* Define to 1 if you have the <mp4.h> header file. */
112
+/* Define to 1 if you have the <mp4v2/mp4v2.h> header file. */
113
+#undef HAVE_MP4V2_MP4V2_H
114
+
115
+/* have mp4 h */
113 116
 #undef HAVE_MP4_H
114 117
 
115 118
 /* have NMM */
@@ -399,6 +402,9 @@ int snprintf(char *str, size_t n, char const *fmt, ...);
399 402
 #endif
400 403
 
401 404
 
405
+/* define to 1 if -fvisibility is supported */
406
+#undef __KDE_HAVE_GCC_VISIBILITY
407
+
402 408
 
403 409
 #if defined(__SVR4) && !defined(__svr4__)
404 410
 #define __svr4__ 1

Loading…
Cancel
Save