mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
SuperMenu: Fix enabling Select All and Find actions
This commit is contained in:
parent
f1a6499b07
commit
8d34cbc02e
|
@ -102,6 +102,9 @@ void MainMenu::initSuperMenu(QMenu* superMenu) const
|
|||
superMenu->addAction(m_actions[QSL("File/WorkOffline")]);
|
||||
superMenu->addSeparator();
|
||||
superMenu->addAction(m_actions[QSL("Standard/Quit")]);
|
||||
|
||||
connect(superMenu, &QMenu::aboutToShow, this, &MainMenu::aboutToShowSuperMenu);
|
||||
connect(superMenu, &QMenu::aboutToHide, this, &MainMenu::aboutToHideSuperMenu);
|
||||
}
|
||||
|
||||
QAction* MainMenu::action(const QString &name) const
|
||||
|
@ -455,6 +458,24 @@ void MainMenu::aboutToHideToolsMenu()
|
|||
m_actions[QSL("Tools/SiteInfo")]->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainMenu::aboutToShowSuperMenu()
|
||||
{
|
||||
if (!m_window) {
|
||||
return;
|
||||
}
|
||||
|
||||
WebView* view = m_window->weView();
|
||||
|
||||
m_actions[QSL("Edit/Find")]->setEnabled(true);
|
||||
m_actions[QSL("Edit/SelectAll")]->setEnabled(view->pageAction(QWebEnginePage::SelectAll)->isEnabled());
|
||||
}
|
||||
|
||||
void MainMenu::aboutToHideSuperMenu()
|
||||
{
|
||||
m_actions[QSL("Edit/Find")]->setEnabled(true);
|
||||
m_actions[QSL("Edit/SelectAll")]->setEnabled(false);
|
||||
}
|
||||
|
||||
void MainMenu::aboutToShowToolbarsMenu()
|
||||
{
|
||||
QMenu* menu = qobject_cast<QMenu*>(sender());
|
||||
|
|
|
@ -111,6 +111,8 @@ private slots:
|
|||
void aboutToHideEditMenu();
|
||||
void aboutToShowToolsMenu();
|
||||
void aboutToHideToolsMenu();
|
||||
void aboutToShowSuperMenu();
|
||||
void aboutToHideSuperMenu();
|
||||
|
||||
void aboutToShowToolbarsMenu();
|
||||
void aboutToShowSidebarsMenu();
|
||||
|
|
Loading…
Reference in New Issue
Block a user