mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Overrided on_dpi_changed() for some Dialogs:
BedShapeDialog, KBShortcutsDialog, ConfigWizard, Preferences
This commit is contained in:
parent
077321b228
commit
e97e8c6af6
13 changed files with 178 additions and 45 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue