Overrided on_dpi_changed() for some Dialogs:

BedShapeDialog, KBShortcutsDialog, ConfigWizard, Preferences
This commit is contained in:
YuSanka 2019-04-18 02:03:40 +02:00
parent 077321b228
commit e97e8c6af6
13 changed files with 178 additions and 45 deletions

View file

@ -7,7 +7,9 @@ namespace Slic3r {
namespace GUI {
PreferencesDialog::PreferencesDialog(wxWindow* parent) :
wxDialog(parent, wxID_ANY, _(L("Preferences")), wxDefaultPosition, wxDefaultSize) {
DPIDialog(parent, wxID_ANY, _(L("Preferences")), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
build();
}
@ -15,7 +17,7 @@ void PreferencesDialog::build()
{
auto app_config = get_app_config();
m_optgroup = std::make_shared<ConfigOptionsGroup>(this, _(L("General")));
m_optgroup->label_width = 40; //400;
m_optgroup->label_width = 40;
m_optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value){
m_values[opt_key] = boost::any_cast<bool>(value) ? "1" : "0";
};
@ -140,5 +142,18 @@ void PreferencesDialog::accept()
wxGetApp().update_ui_from_settings();
}
void PreferencesDialog::on_dpi_changed(const wxRect &suggested_rect)
{
m_optgroup->rescale();
const int& em = em_unit();
const wxSize& size = wxSize(50 * em, 29 * em);
SetMinSize(size);
SetSize(size);
Refresh();
}
} // GUI
} // Slic3r