diff options
author | YuSanka <yusanka@gmail.com> | 2020-08-12 17:12:51 +0300 |
---|---|---|
committer | YuSanka <yusanka@gmail.com> | 2020-08-12 17:13:29 +0300 |
commit | 32595f7659ea42a3e87ab11a237520696b727ead (patch) | |
tree | 9b1279261806c8e852f203c163eb63b834389dfd /src/slic3r | |
parent | 6d4bb10ec59bfee42bc95ef8ea7b3892573404f0 (diff) |
Fixed scaling of the SavePresetDialog under MSW
+ fixed misunderstanding typo in PlaterPresetComboBox
Diffstat (limited to 'src/slic3r')
-rw-r--r-- | src/slic3r/GUI/PresetComboBoxes.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index 7539f3616..c62c999f6 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -715,7 +715,7 @@ void PlaterPresetComboBox::update() std::map<wxString, wxBitmap*> nonsys_presets; - wxString selected = ""; + wxString selected_user_preset = ""; wxString tooltip = ""; const std::deque<Preset>& presets = m_collection->get_presets(); @@ -742,7 +742,7 @@ void PlaterPresetComboBox::update() { // Assign an extruder color to the selected item if the extruder color is defined. filament_rgb = preset.config.opt_string("filament_colour", 0); - extruder_rgb = (selected && !extruder_color.empty()) ? extruder_color : filament_rgb; + extruder_rgb = (is_selected && !extruder_color.empty()) ? extruder_color : filament_rgb; single_bar = filament_rgb == extruder_rgb; bitmap_key += single_bar ? filament_rgb : filament_rgb + extruder_rgb; @@ -764,7 +764,7 @@ void PlaterPresetComboBox::update() { nonsys_presets.emplace(wxString::FromUTF8((name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()), bmp); if (is_selected) { - selected = wxString::FromUTF8((name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()); + selected_user_preset = wxString::FromUTF8((name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()); tooltip = wxString::FromUTF8(preset.name.c_str()); } } @@ -776,7 +776,7 @@ void PlaterPresetComboBox::update() set_label_marker(Append(separator(L("User presets")), wxNullBitmap)); for (std::map<wxString, wxBitmap*>::iterator it = nonsys_presets.begin(); it != nonsys_presets.end(); ++it) { Append(it->first, *it->second); - validate_selection(it->first == selected); + validate_selection(it->first == selected_user_preset); } } @@ -1166,7 +1166,13 @@ void SavePresetDialog::Item::accept() SavePresetDialog::SavePresetDialog(Preset::Type type, const std::string& suffix) : DPIDialog(nullptr, wxID_ANY, _L("Save preset"), wxDefaultPosition, wxSize(45 * wxGetApp().em_unit(), 5 * wxGetApp().em_unit()), wxDEFAULT_DIALOG_STYLE | wxICON_WARNING | wxRESIZE_BORDER) { - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); +#if ENABLE_WX_3_1_3_DPI_CHANGED_EVENT + // ys_FIXME! temporary workaround for correct font scaling + // Because of from wxWidgets 3.1.3 auto rescaling is implemented for the Fonts, + // From the very beginning set dialog font to the wxSYS_DEFAULT_GUI_FONT + this->SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); +#endif // ENABLE_WX_3_1_3_DPI_CHANGED_EVENT wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL); |