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/UnsavedChangesDialog.cpp')
-rw-r--r--src/slic3r/GUI/UnsavedChangesDialog.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp
index 38440b16a..b1cfb09e7 100644
--- a/src/slic3r/GUI/UnsavedChangesDialog.cpp
+++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp
@@ -11,6 +11,9 @@
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/PresetBundle.hpp"
+#if ENABLE_COLOR_CLASSES
+#include "libslic3r/Color.hpp"
+#endif // ENABLE_COLOR_CLASSES
#include "format.hpp"
#include "GUI_App.hpp"
#include "Plater.hpp"
@@ -58,8 +61,12 @@ static std::string get_icon_name(Preset::Type type, PrinterTechnology pt) {
static std::string def_text_color()
{
wxColour def_colour = wxGetApp().get_label_clr_default();//wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
+#if ENABLE_COLOR_CLASSES
+ return encode_color(ColorRGB(def_colour.Red(), def_colour.Green(), def_colour.Blue()));
+#else
auto clr_str = wxString::Format(wxT("#%02X%02X%02X"), def_colour.Red(), def_colour.Green(), def_colour.Blue());
return clr_str.ToStdString();
+#endif // ENABLE_COLOR_CLASSES
}
static std::string grey = "#808080";
static std::string orange = "#ed6b21";
@@ -124,8 +131,13 @@ wxBitmap ModelNode::get_bitmap(const wxString& color)
const int icon_height = lround(1.6 * em);
BitmapCache bmp_cache;
+#if ENABLE_COLOR_CLASSES
+ ColorRGB rgb;
+ decode_color(into_u8(color), rgb);
+#else
unsigned char rgb[3];
BitmapCache::parse_color(into_u8(color), rgb);
+#endif // ENABLE_COLOR_CLASSES
// there is no need to scale created solid bitmap
#ifndef __linux__
return bmp_cache.mksolid(icon_width, icon_height, rgb, true);