diff options
author | YuSanka <yusanka@gmail.com> | 2019-04-23 17:33:06 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2019-04-23 17:33:06 +0300 |
commit | aa147482b7adac21ea4a979cdf06ec545877f7c5 (patch) | |
tree | 210a379145e55597022fb4277a49332cf3938d43 /src/slic3r/GUI/PresetBundle.cpp | |
parent | 5e45cff85555991eca3b747972ab6faa1076365e (diff) |
Added _fiction_ resizing for correct MainFrame rendering after DPI changed_object
+ Added a calculation of a empty bitmaps inside presets in respect to em_unit (to avoid assert)
+ Added scaling for PrintHostDialogs and MsgDialog
+ some code refactoring
Diffstat (limited to 'src/slic3r/GUI/PresetBundle.cpp')
-rw-r--r-- | src/slic3r/GUI/PresetBundle.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index 7de8c99aa..b2fa0a857 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -1451,7 +1451,7 @@ void PresetBundle::load_default_preset_bitmaps(wxWindow *window) this->load_compatible_bitmaps(window); } -void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::PresetComboBox *ui, const int em/* = 10*/) +void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::PresetComboBox *ui) { if (ui == nullptr || this->printers.get_edited_preset().printer_technology() == ptSLA || this->filament_presets.size() <= idx_extruder ) @@ -1479,9 +1479,9 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::Pr /* It's supposed that standard size of an icon is 16px*16px for 100% scaled display. * So set sizes for solid_colored icons used for filament preset - * and scale then in respect to em_unit value + * and scale them in respect to em_unit value */ - const float scale_f = em * 0.1f; + const float scale_f = ui->em_unit() * 0.1f; const int icon_height = 16 * scale_f + 0.5f; const int normal_icon_width = 16 * scale_f + 0.5f; const int space_icon_width = 2 * scale_f + 0.5f; @@ -1556,6 +1556,10 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::Pr ui->SetToolTip(ui->GetString(selected_preset_item)); ui->check_selection(); ui->Thaw(); + + // Update control min size after rescale (changed Display DPI under MSW) + if (ui->GetMinWidth() != 20 * ui->em_unit()) + ui->SetMinSize(wxSize(20 * ui->em_unit(), ui->GetSize().GetHeight())); } void PresetBundle::set_default_suppressed(bool default_suppressed) |