Commit bc7a2818 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas
Browse files

don't use sub sub menu for themes; remove useless about menu and

rename some stuff
parent 31fb21ee
Pipeline #139108 passed with stage
in 0 seconds
......@@ -41,30 +41,28 @@ public:
dtkWidgetsMenuBar *menubar = nullptr;
public:
dtkWidgetsMenu *menu_advanced = nullptr;
dtkWidgetsMenu *menu_config = nullptr;
};
dtkWidgetsMenu *dtkWidgetsMainWindowPrivate::populateAdvancedMenu(void)
{
if(!this->menu_advanced) {
this->menu_advanced = this->menubar->addMenu(fa::question, "Advanced");
this->populateThemesMenu(this->menu_advanced);
this->populateAdvancedParametersSwitch(this->menu_advanced);
this->populateAboutMenu(this->menu_advanced);
if(!this->menu_config) {
this->menu_config = this->menubar->addMenu(fa::question, "Configuration");
this->populateThemesMenu(this->menu_config);
this->populateAdvancedParametersSwitch(this->menu_config);
// this->populateAboutMenu(this->menu_advanced);
}
return this->menu_advanced;
return this->menu_config;
}
dtkWidgetsMenu *dtkWidgetsMainWindowPrivate::populateThemesMenu(dtkWidgetsMenu *menu)
{
dtkWidgetsMenu *menu_themes = menu->menu("Themes");
if(!menu_themes) {
menu_themes = menu->addMenu(fa::paintbrush, "Themes");
auto *inner_menu_theme = menu_themes->addMenu(fa::paintbrush, "Choose Theme");
menu_themes = menu->addMenu(fa::paintbrush, "Choose Themes");
for (const QString theme : dtkThemesEngine::instance()->themes()) {
dtkWidgetsMenuItem * item = inner_menu_theme->addItem(new dtkWidgetsMenuItemTheme(theme));
dtkWidgetsMenuItem * item = menu_themes->addItem(new dtkWidgetsMenuItemTheme(theme));
QObject::connect(item, &dtkWidgetsMenuItem::clicked, [=] () {
dtkThemesEngine::instance()->apply(theme);
});
......@@ -79,8 +77,7 @@ dtkWidgetsMenu *dtkWidgetsMainWindowPrivate::populateAboutMenu(dtkWidgetsMenu *m
dtkWidgetsMenu *menu_about = menu->menu("About");
if(!menu_about) {
menu_about = menu->addMenu(fa::question, "About");
menu_about->addMenu(fa::question, "dtk")->addItem(0, "prout");
menu_about->addMenu(fa::question, "dtk environment (conda)")->addItem(0, "Pour Come");
menu_about->addMenu(fa::question, "dtk")->addItem(0, "todo");
}
return menu_about;
......@@ -102,14 +99,13 @@ QObject *dtkWidgetsMainWindowPrivate::populateAdvancedParametersSwitch(dtkWidget
menubar->advancedParametersDisplayed(v.value<dtk::d_bool>());
});
switch_widget = menu->addParameter("Switch", switch_parameter, "dtkWidgetsParameterBoolCheckBox", true);
switch_widget = menu->addParameter("Toggle Advanced Parameters", switch_parameter, "dtkWidgetsParameterBoolCheckBox", true);
QObject::connect(switch_widget, &QWidget::destroyed, [=] () {
delete switch_parameter;
});
}
return switch_widget;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment