summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qsystemtrayicon_mac.mm
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2009-12-11 08:57:27 (GMT)
committeraxis <qt-info@nokia.com>2009-12-11 08:57:27 (GMT)
commit19e406c08fdaa30fd101cd017cc01b2397b67ee3 (patch)
treed93dd980de23b9ca0a53d18fa6af086b98647857 /src/gui/util/qsystemtrayicon_mac.mm
parente355ade4712fa63794403dae3fda807a58e8b88d (diff)
parentb62c6de3eae005da146a9009f86851a1431b1892 (diff)
downloadQt-19e406c08fdaa30fd101cd017cc01b2397b67ee3.zip
Qt-19e406c08fdaa30fd101cd017cc01b2397b67ee3.tar.gz
Qt-19e406c08fdaa30fd101cd017cc01b2397b67ee3.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6-s60
Conflicts: src/s60installs/bwins/QtGuiu.def
Diffstat (limited to 'src/gui/util/qsystemtrayicon_mac.mm')
-rw-r--r--src/gui/util/qsystemtrayicon_mac.mm28
1 files changed, 28 insertions, 0 deletions
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))