This commit is contained in:
enricoturri1966 2021-07-29 13:28:16 +02:00
commit 438439fd71
30 changed files with 2118 additions and 199 deletions

View file

@ -11,14 +11,14 @@
namespace Slic3r {
namespace GUI {
PreferencesDialog::PreferencesDialog(wxWindow* parent) :
PreferencesDialog::PreferencesDialog(wxWindow* parent, int selected_tab) :
DPIDialog(parent, wxID_ANY, _L("Preferences"), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_DIALOG_STYLE)
{
#ifdef __WXOSX__
isOSX = true;
#endif
build();
build(selected_tab);
}
static std::shared_ptr<ConfigOptionsGroup>create_options_tab(const wxString& title, wxBookCtrlBase* tabs)
@ -44,7 +44,7 @@ static void activate_options_tab(std::shared_ptr<ConfigOptionsGroup> optgroup)
sizer->Add(optgroup->sizer, 0, wxEXPAND | wxALL, 10);
}
void PreferencesDialog::build()
void PreferencesDialog::build(size_t selected_tab)
{
#ifdef _WIN32
wxGetApp().UpdateDarkUI(this);
@ -341,13 +341,20 @@ void PreferencesDialog::build()
option = Option(def, "tabs_as_menu");
m_optgroup_gui->append_single_option_line(option);
#endif
def.label = L("Show \"Did you know\" hints after start");
def.type = coBool;
def.tooltip = L("If enabled, useful hints are displayed at startup.");
def.set_default_value(new ConfigOptionBool{ app_config->get("show_hints") == "1" });
option = Option(def, "show_hints");
m_optgroup_gui->append_single_option_line(option);
def.label = L("Use custom size for toolbar icons");
def.type = coBool;
def.tooltip = L("If enabled, you can change size of toolbar icons manually.");
def.set_default_value(new ConfigOptionBool{ app_config->get("use_custom_toolbar_size") == "1" });
option = Option(def, "use_custom_toolbar_size");
m_optgroup_gui->append_single_option_line(option);
m_optgroup_gui->append_single_option_line(option);
}
activate_options_tab(m_optgroup_gui);
@ -379,6 +386,9 @@ void PreferencesDialog::build()
}
#endif // ENABLE_ENVIRONMENT_MAP
if (selected_tab < tabs->GetPageCount())
tabs->SetSelection(selected_tab);
auto sizer = new wxBoxSizer(wxVERTICAL);
sizer->Add(tabs, 1, wxEXPAND | wxTOP | wxLEFT | wxRIGHT, 5);