summaryrefslogtreecommitdiffstats
path: root/src/widgets/util/qsystemtrayicon_mac.mm
diff options
context:
space:
mode:
authorMorten Sorvig <morten.sorvig@nokia.com>2011-09-29 14:29:05 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-10 07:47:58 +0200
commit9fa6e8f627d0c61fd5a3b993903a362dc04bf707 (patch)
tree56858ef0994ef4b300d5f6928fa51b0844bf1861 /src/widgets/util/qsystemtrayicon_mac.mm
parent33233ca3e3d79152744eedd353106c5d95737e00 (diff)
Clean-up a macro for Cocoa
Remove the usage of Q_MAC_USE_COCOA and Carbon code paths. Change-Id: Ib569ad8c6d9ffe258f454b3c3b06e95294a10112 Reviewed-on: http://codereview.qt-project.org/5100 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Sanity-Review: Morten Johan Sørvig <morten.sorvig@nokia.com>
Diffstat (limited to 'src/widgets/util/qsystemtrayicon_mac.mm')
-rw-r--r--src/widgets/util/qsystemtrayicon_mac.mm20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/widgets/util/qsystemtrayicon_mac.mm b/src/widgets/util/qsystemtrayicon_mac.mm
index 4186ac3e55..5553c63723 100644
--- a/src/widgets/util/qsystemtrayicon_mac.mm
+++ b/src/widgets/util/qsystemtrayicon_mac.mm
@@ -188,12 +188,8 @@ void QSystemTrayIconPrivate::updateIcon_sys()
{
if(sys && !icon.isNull()) {
QMacCocoaAutoReleasePool pool;
-#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(icon.pixmap(QSize(scale, scale))));
[(NSImageView*)[[sys->item item] view] setImage: nsimage];
[nsimage release];
@@ -321,12 +317,8 @@ QT_END_NAMESPACE
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];
@@ -344,12 +336,8 @@ QT_END_NAMESPACE
int clickCount = [mouseEvent clickCount];
[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 (![self icon]->icon().isNull() ) {
NSImage *nsaltimage = static_cast<NSImage *>(qt_mac_create_nsimage([self icon]->icon().pixmap(QSize(scale, scale), QIcon::Selected)));
@@ -453,10 +441,6 @@ QT_END_NAMESPACE
qtsystray_sendActivated(icon, QSystemTrayIcon::Trigger);
if (icon->contextMenu()) {
-#ifndef QT_MAC_USE_COCOA
- [[[self item] view] removeAllToolTips];
- iconPrivate->updateToolTip_sys();
-#endif
NSMenu *m = [[QT_MANGLE_NAMESPACE(QNSMenu) alloc] initWithQMenu:icon->contextMenu()];
[m setAutoenablesItems: NO];
[[NSNotificationCenter defaultCenter] addObserver:imageCell
@@ -533,11 +517,7 @@ private:
[item setToolTip:(NSString*)QCFString::toCFStringRef(action->toolTip())];
const QIcon icon = action->icon();
if(!icon.isNull()) {
-#ifndef QT_MAC_USE_COCOA
- const short scale = GetMBarHeight();
-#else
const short scale = [[NSApp mainMenu] menuBarHeight];
-#endif
NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(icon.pixmap(QSize(scale, scale))));
[item setImage: nsimage];
[nsimage release];