1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Mac: SuperMenu button is now available on Mac

This commit is contained in:
David Rosca 2014-09-25 14:42:36 +02:00
parent e83d75f251
commit 56dcdfe4a2
3 changed files with 16 additions and 15 deletions

View File

@ -474,7 +474,10 @@ void BrowserWindow::loadSettings()
statusBar()->setVisible(!isFullScreen() && showStatusBar);
m_bookmarksToolbar->setVisible(showBookmarksToolbar);
m_navigationToolbar->setVisible(showNavigationToolbar);
#ifndef Q_OS_MAC
menuBar()->setVisible(!isFullScreen() && showMenuBar);
#endif
m_navigationToolbar->setSuperMenuVisible(!showMenuBar);
m_navigationToolbar->buttonReloadStop()->setVisible(showReloadButton);
@ -821,10 +824,12 @@ void BrowserWindow::toggleShowNavigationToolbar()
Settings().setValue("Browser-View-Settings/showNavigationToolbar", m_navigationToolbar->isVisible());
#ifndef Q_OS_MAC
// Make sure we show Menu Bar when Navigation Toolbar is hidden
if (!m_navigationToolbar->isVisible() && !menuBar()->isVisible()) {
toggleShowMenubar();
}
#endif
}
void BrowserWindow::toggleTabsOnTop(bool enable)
@ -944,9 +949,13 @@ void BrowserWindow::restoreWindowState(const RestoreManager::WindowData &d)
void BrowserWindow::createToolbarsMenu(QMenu* menu)
{
QAction* action = menu->addAction(tr("&Menu Bar"), this, SLOT(toggleShowMenubar()));
QAction* action;
#ifndef Q_OS_MAC
action = menu->addAction(tr("&Menu Bar"), this, SLOT(toggleShowMenubar()));
action->setCheckable(true);
action->setChecked(menuBar()->isVisible());
#endif
action = menu->addAction(tr("&Navigation Toolbar"), this, SLOT(toggleShowNavigationToolbar()));
action->setCheckable(true);
@ -1102,9 +1111,11 @@ bool BrowserWindow::event(QEvent* event)
// Enter fullscreen
m_windowStates = ev->oldState();
m_menuBarVisible = menuBar()->isVisible();
m_statusBarVisible = statusBar()->isVisible();
#ifndef Q_OS_MAC
m_menuBarVisible = menuBar()->isVisible();
menuBar()->hide();
#endif
statusBar()->hide();
m_navigationContainer->hide();
@ -1122,8 +1133,10 @@ bool BrowserWindow::event(QEvent* event)
// Leave fullscreen
setWindowState(m_windowStates);
menuBar()->setVisible(m_menuBarVisible);
statusBar()->setVisible(m_statusBarVisible);
#ifndef Q_OS_MAC
menuBar()->setVisible(m_menuBarVisible);
#endif
m_navigationContainer->show();
m_navigationToolbar->setSuperMenuVisible(!m_menuBarVisible);

View File

@ -101,9 +101,6 @@ MainApplication::MainApplication(int &argc, char** argv)
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2)
, m_registerQAppAssociation(0)
#endif
#ifdef Q_OS_MAC
, m_macDockMenu(0)
#endif
{
setApplicationName(QLatin1String("QupZilla"));
setApplicationVersion(Qz::VERSION);

View File

@ -100,7 +100,6 @@ NavigationBar::NavigationBar(BrowserWindow* window)
m_buttonForward->setMenu(m_menuForward);
connect(m_buttonForward, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowHistoryNextMenu()));
#ifndef Q_OS_MAC
m_supMenu = new ToolButton(this);
m_supMenu->setObjectName("navigation-button-supermenu");
m_supMenu->setPopupMode(QToolButton::InstantPopup);
@ -110,7 +109,6 @@ NavigationBar::NavigationBar(BrowserWindow* window)
m_supMenu->setFocusPolicy(Qt::NoFocus);
m_supMenu->setMenu(m_window->superMenu());
m_supMenu->setShowMenuInside(true);
#endif
m_searchLine = new WebSearchBar(m_window);
@ -135,9 +133,7 @@ NavigationBar::NavigationBar(BrowserWindow* window)
m_layout->addWidget(m_buttonHome);
m_layout->addWidget(m_buttonAddTab);
m_layout->addWidget(m_navigationSplitter);
#ifndef Q_OS_MAC
m_layout->addWidget(m_supMenu);
#endif
m_layout->addWidget(m_exitFullscreen);
setContextMenuPolicy(Qt::CustomContextMenu);
@ -187,11 +183,6 @@ void NavigationBar::showStopButton()
void NavigationBar::setSuperMenuVisible(bool visible)
{
#ifdef Q_OS_MAC
Q_UNUSED(visible)
return;
#endif
m_supMenu->setVisible(visible);
}