From 0c0874f98a2ab99a99b984fb1b0f0e0d90c1accb Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Sat, 24 Sep 2011 09:31:58 -0400 Subject: [PATCH] On MacOSX, put menus inside konsole window. KDE's menuBar()->isTopLevelMenu() hasn't worked for a while. Without a replacement, let's just put the menus inside the main window. This also makes the keyboard shortcut to show menus look reasonable (instead of floating). --- src/Application.cpp | 5 +++++ src/MainWindow.cpp | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 2058546e..ec20c927 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -61,6 +61,11 @@ void Application::init() // this ensures that Ctrl and Meta are not swapped, so CTRL-C and friends // will work correctly in the terminal setAttribute(Qt::AA_MacDontSwapCtrlAndMeta); + + // KDE's menuBar()->isTopLevel() hasn't worked in a while. + // For now, put menus inside Konsole window; this also make + // the keyboard shortcut to show menus look reasonable. + setAttribute(Qt::AA_DontUseNativeMenuBar); #endif } diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 507fbe30..d31e7d07 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -137,7 +137,7 @@ void MainWindow::removeMenuAccelerators() } void MainWindow::setMenuBarVisibleOnce(bool visible) { - if (_menuBarVisibilitySet || menuBar()->isTopLevelMenu() ) + if (_menuBarVisibilitySet) return; menuBar()->setVisible(visible); @@ -283,10 +283,6 @@ void MainWindow::setupActions() _toggleMenuBarAction = KStandardAction::showMenubar(menuBar(), SLOT(setVisible(bool)), collection); _toggleMenuBarAction->setShortcut( QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M) ); - // Hide the Show/Hide menubar item if the menu bar is a MacOS-style menu bar - if ( menuBar()->isTopLevelMenu() ) - _toggleMenuBarAction->setVisible(false); - // Full Screen action = KStandardAction::fullScreen(this, SLOT(viewFullScreen(bool)), this, collection); action->setShortcut( QKeySequence() );