From 7e88e20402abbf67b734cc118f93e62ad42478e9 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 25 May 2020 09:41:19 +0200 Subject: [PATCH 1/2] Fixed a bitmap getting for the case, when application was started in Light mode and then switched to the Dark --- src/slic3r/GUI/BitmapCache.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/BitmapCache.cpp b/src/slic3r/GUI/BitmapCache.cpp index 8627ef4cb6..74a4bc1c87 100644 --- a/src/slic3r/GUI/BitmapCache.cpp +++ b/src/slic3r/GUI/BitmapCache.cpp @@ -281,16 +281,19 @@ wxBitmap* BitmapCache::load_svg(const std::string &bitmap_name, unsigned target_ auto it = m_map.find(folder + bitmap_key); if (it != m_map.end()) return it->second; - else { + // It's expensive to check if the bitmap exists every time, but otherwise: + // For the case, when application was started in Light mode and then switched to the Dark, + // we will never get a white bitmaps, if check m_map.find(bitmap_key) + // before boost::filesystem::exists(var(folder + bitmap_name + ".svg")) + if (!boost::filesystem::exists(var(folder + bitmap_name + ".svg"))) { + folder.clear(); + it = m_map.find(bitmap_key); if (it != m_map.end()) return it->second; } - if (!boost::filesystem::exists(Slic3r::var(folder + bitmap_name + ".svg"))) - folder.clear(); - else - bitmap_key = folder + bitmap_key; + bitmap_key = folder + bitmap_key; } else { From f78f5c85be5b1695d7034b867ca1881ca6c814e5 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 25 May 2020 10:21:30 +0200 Subject: [PATCH 2/2] MSW specific issue: Fixed scaling of the Tabs when They are in the separated dialog --- src/slic3r/GUI/MainFrame.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 47cd3443d9..20b713bcad 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -561,8 +561,9 @@ void MainFrame::on_dpi_changed(const wxRect &suggested_rect) wxGetApp().plater()->msw_rescale(); // update Tabs - for (auto tab : wxGetApp().tabs_list) - tab->msw_rescale(); + if (m_layout != slDlg) // Update tabs later, from the SettingsDialog, when the Settings are in the separated dialog + for (auto tab : wxGetApp().tabs_list) + tab->msw_rescale(); wxMenuBar* menu_bar = this->GetMenuBar(); for (size_t id = 0; id < menu_bar->GetMenuCount(); id++) @@ -1531,6 +1532,10 @@ void SettingsDialog::on_dpi_changed(const wxRect& suggested_rect) const int& em = em_unit(); const wxSize& size = wxSize(85 * em, 50 * em); + // update Tabs + for (auto tab : wxGetApp().tabs_list) + tab->msw_rescale(); + SetMinSize(size); Fit(); Refresh();