diff options
author | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2009-12-08 09:10:52 (GMT) |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@nokia.com> | 2009-12-08 09:10:52 (GMT) |
commit | 3f5e4ed4d2b110f4c6e952b74c9f852a2dc14a54 (patch) | |
tree | bdd95d791244c6cc72a19a48118ab72ff5edcfb2 /src/gui/util | |
parent | 55be2d1d684d4505db3bbf76da0cf8326cee9468 (diff) | |
parent | dfbdb86fd4614be9be17cbfb602ed5a3b5a38671 (diff) | |
download | Qt-3f5e4ed4d2b110f4c6e952b74c9f852a2dc14a54.zip Qt-3f5e4ed4d2b110f4c6e952b74c9f852a2dc14a54.tar.gz Qt-3f5e4ed4d2b110f4c6e952b74c9f852a2dc14a54.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/gui/util')
-rw-r--r-- | src/gui/util/qsystemtrayicon_mac.mm | 28 |
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)) |