diff options
author | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2013-08-16 16:02:19 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-16 16:02:19 +0200 |
commit | e72785547696146f6172f0ef2824033e17df7b50 (patch) | |
tree | e78d6bafd7b3bcd9e786b5da8150cf02dcf2b4bb /src/plugins/platforms/cocoa/qcocoamenubar.mm | |
parent | ac5c64fccd6d491ee3b3a3f54460ed3464d714fc (diff) | |
parent | 5c23199d4e8ff21661dfa5aacc13149178e78cab (diff) |
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoamenubar.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoamenubar.mm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm index da2704f19c..0fea55ac68 100644 --- a/src/plugins/platforms/cocoa/qcocoamenubar.mm +++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm @@ -149,15 +149,17 @@ void QCocoaMenuBar::syncMenu(QPlatformMenu *menu) Q_FOREACH (QCocoaMenuItem *item, cocoaMenu->items()) cocoaMenu->syncMenuItem(item); - // If the NSMenu has no visble items, or only separators, we should hide it - // on the menubar. This can happen after syncing the menu items since they - // can be moved to other menus. BOOL shouldHide = YES; - for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray]) - if (![item isSeparatorItem] && ![item isHidden]) { - shouldHide = NO; - break; - } + if (cocoaMenu->isVisible()) { + // If the NSMenu has no visble items, or only separators, we should hide it + // on the menubar. This can happen after syncing the menu items since they + // can be moved to other menus. + for (NSMenuItem *item in [cocoaMenu->nsMenu() itemArray]) + if (![item isSeparatorItem] && ![item isHidden]) { + shouldHide = NO; + break; + } + } [cocoaMenu->nsMenuItem() setHidden:shouldHide]; } |