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).
wilder-portage
Kurt Hindenburg 15 years ago
parent 272ac9850e
commit 0c0874f98a
  1. 5
      src/Application.cpp
  2. 6
      src/MainWindow.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
}

@ -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() );

Loading…
Cancel
Save