comparison main/MainWindow.cpp @ 1458:96057b1185cb 3.0-integration

Don't show icons on menus in OSX
author Chris Cannam
date Tue, 03 Jan 2017 13:05:02 +0000
parents e4f223fc9099
children 8ca62b402846 0a145f215a45
comparison
equal deleted inserted replaced
1457:c73d90d378ac 1458:96057b1185cb
351 void 351 void
352 MainWindow::setupMenus() 352 MainWindow::setupMenus()
353 { 353 {
354 if (!m_mainMenusCreated) { 354 if (!m_mainMenusCreated) {
355 355
356 #ifdef Q_OS_MAC
357 // Mac doesn't align menu labels when icons are shown: result is messy
358 QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
359 #endif
360
356 #ifdef Q_OS_LINUX 361 #ifdef Q_OS_LINUX
357 // In Ubuntu 14.04 the window's menu bar goes missing entirely 362 // In Ubuntu 14.04 the window's menu bar goes missing entirely
358 // if the user is running any desktop environment other than Unity 363 // if the user is running any desktop environment other than Unity
359 // (in which the faux single-menubar appears). The user has a 364 // (in which the faux single-menubar appears). The user has a
360 // workaround, to remove the appmenu-qt5 package, but that is 365 // workaround, to remove the appmenu-qt5 package, but that is
361 // awkward and the problem is so severe that it merits disabling 366 // awkward and the problem is so severe that it merits disabling
362 // the system menubar integration altogether. Like this: 367 // the system menubar integration altogether. Like this:
363 menuBar()->setNativeMenuBar(false); // fix #1039 368 menuBar()->setNativeMenuBar(false); // fix #1039
364 #endif 369 #endif
365 370
366 m_rightButtonMenu = new QMenu(); 371 m_rightButtonMenu = new QMenu();
367 372
368 // No -- we don't want tear-off enabled on the right-button 373 // We don't want tear-off enabled on the right-button menu.
369 // menu. If it is enabled, then simply right-clicking and 374 // If it is enabled, then simply right-clicking and releasing
370 // releasing will pop up the menu, activate the tear-off, and 375 // will pop up the menu, activate the tear-off, and leave the
371 // leave the torn-off menu window in front of the main window. 376 // torn-off menu window in front of the main window. That
372 // That isn't desirable. I'm not sure it ever would be, in a 377 // isn't desirable.
373 // context menu -- perhaps technically a Qt bug? 378 m_rightButtonMenu->setTearOffEnabled(false);
374 // m_rightButtonMenu->setTearOffEnabled(true);
375 } 379 }
376 380
377 if (m_rightButtonTransformsMenu) { 381 if (m_rightButtonTransformsMenu) {
378 m_rightButtonTransformsMenu->clear(); 382 m_rightButtonTransformsMenu->clear();
379 } else { 383 } else {