From f11e81517df6e0a796f0b0c08c6eca9ac6a64436 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Mon, 22 Feb 2021 14:48:24 +0100 Subject: [PATCH] PresetComboBox: Fixed thin/wide_space_icon_width scale + Added border for the color_extruder bitmaps --- src/slic3r/GUI/PresetComboBoxes.cpp | 6 +++--- src/slic3r/GUI/wxExtensions.cpp | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/PresetComboBoxes.cpp b/src/slic3r/GUI/PresetComboBoxes.cpp index 569cb9a29..0754df571 100644 --- a/src/slic3r/GUI/PresetComboBoxes.cpp +++ b/src/slic3r/GUI/PresetComboBoxes.cpp @@ -396,9 +396,9 @@ void PresetComboBox::fill_width_height() thin_icon_width = lroundf(8 * scale_f); // analogue to 8px; wide_icon_width = norm_icon_width + thin_icon_width; - space_icon_width = lroundf(2 * scale_f); - thin_space_icon_width = 2 * space_icon_width; - wide_space_icon_width = 3 * space_icon_width; + space_icon_width = lroundf(2 * scale_f); + thin_space_icon_width = lroundf(4 * scale_f); + wide_space_icon_width = lroundf(6 * scale_f); } wxString PresetComboBox::separator(const std::string& label) diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index e2566e3f9..f58747610 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -467,6 +467,8 @@ std::vector get_extruder_color_icons(bool thin_icon/* = false*/) const int icon_width = lround((thin_icon ? 1.6 : 3.2) * em); const int icon_height = lround(1.6 * em); + bool dark_mode = Slic3r::GUI::wxGetApp().dark_mode(); + for (const std::string& color : colors) { std::string bitmap_key = color + "-h" + std::to_string(icon_height) + "-w" + std::to_string(icon_width); @@ -476,7 +478,7 @@ std::vector get_extruder_color_icons(bool thin_icon/* = false*/) // Paint the color icon. Slic3r::GUI::BitmapCache::parse_color(color, rgb); // there is no neede to scale created solid bitmap - bitmap = bmp_cache.insert(bitmap_key, bmp_cache.mksolid(icon_width, icon_height, rgb, true)); + bitmap = bmp_cache.insert(bitmap_key, bmp_cache.mksolid(icon_width, icon_height, rgb, false, 1, dark_mode)); } bmps.emplace_back(bitmap); }