Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/slic3r/GUI/wxExtensions.cpp')
-rw-r--r--src/slic3r/GUI/wxExtensions.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp
index 01a553a81..9712a41b3 100644
--- a/src/slic3r/GUI/wxExtensions.cpp
+++ b/src/slic3r/GUI/wxExtensions.cpp
@@ -17,6 +17,10 @@
#include "../Utils/MacDarkMode.hpp"
#include "BitmapComboBox.hpp"
+#if ENABLE_COLOR_CLASSES
+#include "libslic3r/Color.hpp"
+#endif // ENABLE_COLOR_CLASSES
+
#ifndef __linux__
// msw_menuitem_bitmaps is used for MSW and OSX
static std::map<int, std::string> msw_menuitem_bitmaps;
@@ -471,7 +475,9 @@ std::vector<wxBitmap*> get_extruder_color_icons(bool thin_icon/* = false*/)
if (colors.empty())
return bmps;
+#if !ENABLE_COLOR_CLASSES
unsigned char rgb[3];
+#endif // !ENABLE_COLOR_CLASSES
/* It's supposed that standard size of an icon is 36px*16px for 100% scaled display.
* So set sizes for solid_colored icons used for filament preset
@@ -489,10 +495,18 @@ std::vector<wxBitmap*> get_extruder_color_icons(bool thin_icon/* = false*/)
wxBitmap* bitmap = bmp_cache.find(bitmap_key);
if (bitmap == nullptr) {
+#if ENABLE_COLOR_CLASSES
+ // Paint the color icon.
+ Slic3r::ColorRGB rgb;
+ Slic3r::decode_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, 1, dark_mode));
+#else
// 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, 1, dark_mode));
+#endif // ENABLE_COLOR_CLASSES
}
bmps.emplace_back(bitmap);
}