Tech ENABLE_COLOR_CLASSES set as default

This commit is contained in:
enricoturri1966 2022-01-14 08:19:00 +01:00
parent fab35e8aa4
commit 6201dad245
50 changed files with 18 additions and 1500 deletions

View file

@ -11,9 +11,7 @@
#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"
@ -61,12 +59,7 @@ 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();
#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";
@ -131,13 +124,8 @@ 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);