feat: Add empty menu
Signed-off-by: Redson <redson@riseup.net>
This commit is contained in:
parent
074b53eb6b
commit
be765f8d88
@ -264,6 +264,8 @@ public:
|
|||||||
|
|
||||||
TranslatedAction actionLockToolbars;
|
TranslatedAction actionLockToolbars;
|
||||||
|
|
||||||
|
TranslatedAction actionChangeTheme;
|
||||||
|
|
||||||
QVector<TranslatedToolButton *> all_toolbuttons;
|
QVector<TranslatedToolButton *> all_toolbuttons;
|
||||||
|
|
||||||
QWidget *centralWidget = nullptr;
|
QWidget *centralWidget = nullptr;
|
||||||
@ -428,6 +430,11 @@ public:
|
|||||||
actionLockToolbars.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Lock Toolbars"));
|
actionLockToolbars.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Lock Toolbars"));
|
||||||
actionLockToolbars->setCheckable(true);
|
actionLockToolbars->setCheckable(true);
|
||||||
all_actions.append(&actionLockToolbars);
|
all_actions.append(&actionLockToolbars);
|
||||||
|
|
||||||
|
actionChangeTheme = TranslatedAction(MainWindow);
|
||||||
|
actionChangeTheme->setObjectName(QStringLiteral("actionChangeTheme"));
|
||||||
|
actionChangeTheme.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Themes"));
|
||||||
|
all_actions.append(&actionChangeTheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
void createMainToolbar(QMainWindow *MainWindow)
|
void createMainToolbar(QMainWindow *MainWindow)
|
||||||
@ -528,6 +535,8 @@ public:
|
|||||||
|
|
||||||
viewMenu = menuBar->addMenu(tr("&View"));
|
viewMenu = menuBar->addMenu(tr("&View"));
|
||||||
viewMenu->setSeparatorsCollapsible(false);
|
viewMenu->setSeparatorsCollapsible(false);
|
||||||
|
viewMenu->addAction(actionChangeTheme);
|
||||||
|
viewMenu->addSeparator();
|
||||||
viewMenu->addAction(actionCAT);
|
viewMenu->addAction(actionCAT);
|
||||||
viewMenu->addSeparator();
|
viewMenu->addSeparator();
|
||||||
|
|
||||||
@ -822,6 +831,7 @@ public:
|
|||||||
createInstanceToolbar(MainWindow);
|
createInstanceToolbar(MainWindow);
|
||||||
|
|
||||||
MainWindow->updateToolsMenu();
|
MainWindow->updateToolsMenu();
|
||||||
|
MainWindow->updateThemeMenu();
|
||||||
|
|
||||||
retranslateUi(MainWindow);
|
retranslateUi(MainWindow);
|
||||||
|
|
||||||
@ -1271,6 +1281,22 @@ void MainWindow::updateToolsMenu()
|
|||||||
ui->actionLaunchInstance->setMenu(launchMenu);
|
ui->actionLaunchInstance->setMenu(launchMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::updateThemeMenu()
|
||||||
|
{
|
||||||
|
QMenu *themeMenu = ui->actionChangeTheme->menu();
|
||||||
|
|
||||||
|
if (themeMenu)
|
||||||
|
{
|
||||||
|
themeMenu->clear();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
themeMenu = new QMenu(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->actionChangeTheme->setMenu(themeMenu);
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::repopulateAccountsMenu()
|
void MainWindow::repopulateAccountsMenu()
|
||||||
{
|
{
|
||||||
accountMenu->clear();
|
accountMenu->clear();
|
||||||
|
@ -170,6 +170,8 @@ private slots:
|
|||||||
|
|
||||||
void updateToolsMenu();
|
void updateToolsMenu();
|
||||||
|
|
||||||
|
void updateThemeMenu();
|
||||||
|
|
||||||
void instanceActivated(QModelIndex);
|
void instanceActivated(QModelIndex);
|
||||||
|
|
||||||
void instanceChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
void instanceChanged(const QModelIndex ¤t, const QModelIndex &previous);
|
||||||
|
Loading…
Reference in New Issue
Block a user