mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Mac: SuperMenu button is now available on Mac
This commit is contained in:
parent
e83d75f251
commit
56dcdfe4a2
@ -474,7 +474,10 @@ void BrowserWindow::loadSettings()
|
|||||||
statusBar()->setVisible(!isFullScreen() && showStatusBar);
|
statusBar()->setVisible(!isFullScreen() && showStatusBar);
|
||||||
m_bookmarksToolbar->setVisible(showBookmarksToolbar);
|
m_bookmarksToolbar->setVisible(showBookmarksToolbar);
|
||||||
m_navigationToolbar->setVisible(showNavigationToolbar);
|
m_navigationToolbar->setVisible(showNavigationToolbar);
|
||||||
|
|
||||||
|
#ifndef Q_OS_MAC
|
||||||
menuBar()->setVisible(!isFullScreen() && showMenuBar);
|
menuBar()->setVisible(!isFullScreen() && showMenuBar);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_navigationToolbar->setSuperMenuVisible(!showMenuBar);
|
m_navigationToolbar->setSuperMenuVisible(!showMenuBar);
|
||||||
m_navigationToolbar->buttonReloadStop()->setVisible(showReloadButton);
|
m_navigationToolbar->buttonReloadStop()->setVisible(showReloadButton);
|
||||||
@ -821,10 +824,12 @@ void BrowserWindow::toggleShowNavigationToolbar()
|
|||||||
|
|
||||||
Settings().setValue("Browser-View-Settings/showNavigationToolbar", m_navigationToolbar->isVisible());
|
Settings().setValue("Browser-View-Settings/showNavigationToolbar", m_navigationToolbar->isVisible());
|
||||||
|
|
||||||
|
#ifndef Q_OS_MAC
|
||||||
// Make sure we show Menu Bar when Navigation Toolbar is hidden
|
// Make sure we show Menu Bar when Navigation Toolbar is hidden
|
||||||
if (!m_navigationToolbar->isVisible() && !menuBar()->isVisible()) {
|
if (!m_navigationToolbar->isVisible() && !menuBar()->isVisible()) {
|
||||||
toggleShowMenubar();
|
toggleShowMenubar();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWindow::toggleTabsOnTop(bool enable)
|
void BrowserWindow::toggleTabsOnTop(bool enable)
|
||||||
@ -944,9 +949,13 @@ void BrowserWindow::restoreWindowState(const RestoreManager::WindowData &d)
|
|||||||
|
|
||||||
void BrowserWindow::createToolbarsMenu(QMenu* menu)
|
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->setCheckable(true);
|
||||||
action->setChecked(menuBar()->isVisible());
|
action->setChecked(menuBar()->isVisible());
|
||||||
|
#endif
|
||||||
|
|
||||||
action = menu->addAction(tr("&Navigation Toolbar"), this, SLOT(toggleShowNavigationToolbar()));
|
action = menu->addAction(tr("&Navigation Toolbar"), this, SLOT(toggleShowNavigationToolbar()));
|
||||||
action->setCheckable(true);
|
action->setCheckable(true);
|
||||||
@ -1102,9 +1111,11 @@ bool BrowserWindow::event(QEvent* event)
|
|||||||
// Enter fullscreen
|
// Enter fullscreen
|
||||||
m_windowStates = ev->oldState();
|
m_windowStates = ev->oldState();
|
||||||
|
|
||||||
m_menuBarVisible = menuBar()->isVisible();
|
|
||||||
m_statusBarVisible = statusBar()->isVisible();
|
m_statusBarVisible = statusBar()->isVisible();
|
||||||
|
#ifndef Q_OS_MAC
|
||||||
|
m_menuBarVisible = menuBar()->isVisible();
|
||||||
menuBar()->hide();
|
menuBar()->hide();
|
||||||
|
#endif
|
||||||
statusBar()->hide();
|
statusBar()->hide();
|
||||||
|
|
||||||
m_navigationContainer->hide();
|
m_navigationContainer->hide();
|
||||||
@ -1122,8 +1133,10 @@ bool BrowserWindow::event(QEvent* event)
|
|||||||
// Leave fullscreen
|
// Leave fullscreen
|
||||||
setWindowState(m_windowStates);
|
setWindowState(m_windowStates);
|
||||||
|
|
||||||
menuBar()->setVisible(m_menuBarVisible);
|
|
||||||
statusBar()->setVisible(m_statusBarVisible);
|
statusBar()->setVisible(m_statusBarVisible);
|
||||||
|
#ifndef Q_OS_MAC
|
||||||
|
menuBar()->setVisible(m_menuBarVisible);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_navigationContainer->show();
|
m_navigationContainer->show();
|
||||||
m_navigationToolbar->setSuperMenuVisible(!m_menuBarVisible);
|
m_navigationToolbar->setSuperMenuVisible(!m_menuBarVisible);
|
||||||
|
@ -101,9 +101,6 @@ MainApplication::MainApplication(int &argc, char** argv)
|
|||||||
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2)
|
#if defined(Q_OS_WIN) && !defined(Q_OS_OS2)
|
||||||
, m_registerQAppAssociation(0)
|
, m_registerQAppAssociation(0)
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
, m_macDockMenu(0)
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
setApplicationName(QLatin1String("QupZilla"));
|
setApplicationName(QLatin1String("QupZilla"));
|
||||||
setApplicationVersion(Qz::VERSION);
|
setApplicationVersion(Qz::VERSION);
|
||||||
|
@ -100,7 +100,6 @@ NavigationBar::NavigationBar(BrowserWindow* window)
|
|||||||
m_buttonForward->setMenu(m_menuForward);
|
m_buttonForward->setMenu(m_menuForward);
|
||||||
connect(m_buttonForward, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowHistoryNextMenu()));
|
connect(m_buttonForward, SIGNAL(aboutToShowMenu()), this, SLOT(aboutToShowHistoryNextMenu()));
|
||||||
|
|
||||||
#ifndef Q_OS_MAC
|
|
||||||
m_supMenu = new ToolButton(this);
|
m_supMenu = new ToolButton(this);
|
||||||
m_supMenu->setObjectName("navigation-button-supermenu");
|
m_supMenu->setObjectName("navigation-button-supermenu");
|
||||||
m_supMenu->setPopupMode(QToolButton::InstantPopup);
|
m_supMenu->setPopupMode(QToolButton::InstantPopup);
|
||||||
@ -110,7 +109,6 @@ NavigationBar::NavigationBar(BrowserWindow* window)
|
|||||||
m_supMenu->setFocusPolicy(Qt::NoFocus);
|
m_supMenu->setFocusPolicy(Qt::NoFocus);
|
||||||
m_supMenu->setMenu(m_window->superMenu());
|
m_supMenu->setMenu(m_window->superMenu());
|
||||||
m_supMenu->setShowMenuInside(true);
|
m_supMenu->setShowMenuInside(true);
|
||||||
#endif
|
|
||||||
|
|
||||||
m_searchLine = new WebSearchBar(m_window);
|
m_searchLine = new WebSearchBar(m_window);
|
||||||
|
|
||||||
@ -135,9 +133,7 @@ NavigationBar::NavigationBar(BrowserWindow* window)
|
|||||||
m_layout->addWidget(m_buttonHome);
|
m_layout->addWidget(m_buttonHome);
|
||||||
m_layout->addWidget(m_buttonAddTab);
|
m_layout->addWidget(m_buttonAddTab);
|
||||||
m_layout->addWidget(m_navigationSplitter);
|
m_layout->addWidget(m_navigationSplitter);
|
||||||
#ifndef Q_OS_MAC
|
|
||||||
m_layout->addWidget(m_supMenu);
|
m_layout->addWidget(m_supMenu);
|
||||||
#endif
|
|
||||||
m_layout->addWidget(m_exitFullscreen);
|
m_layout->addWidget(m_exitFullscreen);
|
||||||
|
|
||||||
setContextMenuPolicy(Qt::CustomContextMenu);
|
setContextMenuPolicy(Qt::CustomContextMenu);
|
||||||
@ -187,11 +183,6 @@ void NavigationBar::showStopButton()
|
|||||||
|
|
||||||
void NavigationBar::setSuperMenuVisible(bool visible)
|
void NavigationBar::setSuperMenuVisible(bool visible)
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_MAC
|
|
||||||
Q_UNUSED(visible)
|
|
||||||
return;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_supMenu->setVisible(visible);
|
m_supMenu->setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user