From 2fe63e0b045361584e9320039088c7634303017a Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Fri, 12 Apr 2019 10:57:30 +0200 Subject: [PATCH] Revert high DPI bitmaps in Preset and PresetBundle for now due to bugs in wxBitmapComboBox et al. --- src/slic3r/GUI/Preset.cpp | 8 ++++++-- src/slic3r/GUI/PresetBundle.cpp | 15 +++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index 97c42d7fb..bed960a62 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -801,12 +801,16 @@ bool PresetCollection::delete_current_preset() void PresetCollection::load_bitmap_default(wxWindow *window, const std::string &file_name) { - *m_bitmap_main_frame = create_scaled_bitmap(window, file_name); + // XXX: See note in PresetBundle::load_compatible_bitmaps() + (void)window; + *m_bitmap_main_frame = create_scaled_bitmap(nullptr, file_name); } void PresetCollection::load_bitmap_add(wxWindow *window, const std::string &file_name) { - *m_bitmap_add = create_scaled_bitmap(window, file_name); + // XXX: See note in PresetBundle::load_compatible_bitmaps() + (void)window; + *m_bitmap_add = create_scaled_bitmap(nullptr, file_name); } const Preset* PresetCollection::get_selected_preset_parent() const diff --git a/src/slic3r/GUI/PresetBundle.cpp b/src/slic3r/GUI/PresetBundle.cpp index ad7829b2c..a8a63056c 100644 --- a/src/slic3r/GUI/PresetBundle.cpp +++ b/src/slic3r/GUI/PresetBundle.cpp @@ -398,10 +398,17 @@ void PresetBundle::export_selections(AppConfig &config) void PresetBundle::load_compatible_bitmaps(wxWindow *window) { - *m_bitmapCompatible = create_scaled_bitmap(window, "flag_green"); - *m_bitmapIncompatible = create_scaled_bitmap(window, "flag_red"); - *m_bitmapLock = create_scaled_bitmap(window, "lock_closed"); - *m_bitmapLockOpen = create_scaled_bitmap(window, "sys_unlock.png"); + // We don't actually pass the window pointer here and instead generate + // a low DPI bitmap, because the wxBitmapComboBox and wxDataViewControl don't support + // high DPI bitmaps very well, they compute their dimensions wrong. + // TODO: Update this when fixed in wxWidgets + // See also PresetCollection::load_bitmap_default() and PresetCollection::load_bitmap_add() + + (void)window; + *m_bitmapCompatible = create_scaled_bitmap(nullptr, "flag_green"); + *m_bitmapIncompatible = create_scaled_bitmap(nullptr, "flag_red"); + *m_bitmapLock = create_scaled_bitmap(nullptr, "lock_closed"); + *m_bitmapLockOpen = create_scaled_bitmap(nullptr, "sys_unlock.png"); prints .set_bitmap_compatible(m_bitmapCompatible); filaments .set_bitmap_compatible(m_bitmapCompatible);