diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-12-09 13:23:47 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-12-09 13:23:47 (GMT) |
commit | 5c8afa87bcb975681b42529456335583df314ff5 (patch) | |
tree | 8960be5a0f3147a30c96151fe5af8d651e95343a /src/gui/util | |
parent | eea71824f57dd61b0a513e3bbb5ced99de505d73 (diff) | |
parent | bc4077223affd542f5fb24e27a065b7999229654 (diff) | |
download | Qt-5c8afa87bcb975681b42529456335583df314ff5.zip Qt-5c8afa87bcb975681b42529456335583df314ff5.tar.gz Qt-5c8afa87bcb975681b42529456335583df314ff5.tar.bz2 |
Merge commit 'origin/4.6' into 4.6-upstream
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qsystemtrayicon.cpp | 3 | ||||
-rw-r--r-- | src/gui/util/qsystemtrayicon_mac.mm | 28 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/gui/util/qsystemtrayicon.cpp b/src/gui/util/qsystemtrayicon.cpp index c6ea00f..6f2b501 100644 --- a/src/gui/util/qsystemtrayicon.cpp +++ b/src/gui/util/qsystemtrayicon.cpp @@ -380,6 +380,9 @@ bool QSystemTrayIcon::supportsMessages() On Windows, the \a millisecondsTimeoutHint is usually ignored by the system when the application has focus. + On Mac OS X, the Growl notification system must be installed for this function to + display messages. + \sa show() supportsMessages() */ void QSystemTrayIcon::showMessage(const QString& title, const QString& msg, diff --git a/src/gui/util/qsystemtrayicon_mac.mm b/src/gui/util/qsystemtrayicon_mac.mm index b74ca85..93295a7 100644 --- a/src/gui/util/qsystemtrayicon_mac.mm +++ b/src/gui/util/qsystemtrayicon_mac.mm @@ -314,8 +314,22 @@ QT_END_NAMESPACE { Q_UNUSED(notification); down = NO; + + if( ![self icon]->icon().isNull() ) { +#ifndef QT_MAC_USE_COCOA + const short scale = GetMBarHeight()-4; +#else + CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; + const short scale = hgt - 4; +#endif + NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale)))); + [self setImage: nsimage]; + [nsimage release]; + } + if([self icon]->contextMenu()) [self icon]->contextMenu()->hide(); + [self setNeedsDisplay:YES]; } @@ -327,6 +341,20 @@ QT_END_NAMESPACE [self icon]->contextMenu()->hide(); [self setNeedsDisplay:YES]; +#ifndef QT_MAC_USE_COCOA + const short scale = GetMBarHeight()-4; +#else + CGFloat hgt = [[[NSApplication sharedApplication] mainMenu] menuBarHeight]; + const short scale = hgt - 4; +#endif + + if( down && ![self icon]->icon().isNull() ) { + NSImage *nsaltimage = static_cast<NSImage *>(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale), QIcon::Selected))); + [self setImage: nsaltimage]; + [nsaltimage release]; + } + + if (down) [parent triggerSelector:self]; else if ((clickCount%2)) |