diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 0a03d4bba..3e16cf407 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1356,15 +1356,16 @@ void Sidebar::load_ams_list(std::map const &list) { std::vector filament_ams_list; for (auto ams : list) { + char n = ams.first.front() - '0' + 'A'; for (auto tray : ams.second->trayList) { if (tray.second->setting_id.empty()) continue; BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(": ams %1% tray %2% id %3% color %4%") % ams.first % tray.first % tray.second->setting_id % tray.second->color; - char n = ams.first.front() - '0' + 'A'; + char t = tray.first.front() - '0' + '1'; DynamicPrintConfig ams; ams.set_key_value("filament_id", new ConfigOptionStrings{tray.second->setting_id}); ams.set_key_value("filament_type", new ConfigOptionStrings{tray.second->type}); - ams.set_key_value("tray_name", new ConfigOptionStrings{std::string(1, n) + tray.first}); + ams.set_key_value("tray_name", new ConfigOptionStrings{std::string(1, n) + std::string(1, t)}); ams.set_key_value("filament_colour", new ConfigOptionStrings{"#" + tray.second->color.substr(0, 6)}); filament_ams_list.emplace_back(std::move(ams)); } diff --git a/src/slic3r/GUI/Widgets/DropDown.cpp b/src/slic3r/GUI/Widgets/DropDown.cpp index fd464498c..1852212a0 100644 --- a/src/slic3r/GUI/Widgets/DropDown.cpp +++ b/src/slic3r/GUI/Widgets/DropDown.cpp @@ -179,6 +179,15 @@ void DropDown::paintNow() Refresh(); } +static wxSize GetBmpSize(wxBitmap & bmp) +{ +#ifdef __APPLE__ + return bmp.GetScaledSize(); +#else + return bmp.GetSize(); +#endif +} + /* * Here we do the actual rendering. I put it in a separate * method so that it can work no matter what type of DC @@ -267,18 +276,19 @@ void DropDown::render(wxDC &dc) } if (rcContent.y > size.y) break; wxPoint pt = rcContent.GetLeftTop(); - auto & icon = icons[i]; + auto & icon = icons[i]; + auto size2 = GetBmpSize(icon); if (iconSize.x > 0) { if (icon.IsOk()) { - pt.y += (rcContent.height - icon.GetSize().y) / 2; + pt.y += (rcContent.height - size2.y) / 2; dc.DrawBitmap(icon, pt); } pt.x += iconSize.x + 5; pt.y = rcContent.y; } else if (icon.IsOk()) { - pt.y += (rcContent.height - icon.GetSize().y) / 2; + pt.y += (rcContent.height - size2.y) / 2; dc.DrawBitmap(icon, pt); - pt.x += icon.GetWidth() + 5; + pt.x += size2.x + 5; pt.y = rcContent.y; } auto text = texts[i]; @@ -305,7 +315,7 @@ void DropDown::messureSize() for (size_t i = 0; i < texts.size(); ++i) { wxSize size1 = text_off ? wxSize() : dc.GetMultiLineTextExtent(texts[i]); if (icons[i].IsOk()) { - wxSize size2 = icons[i].GetSize(); + wxSize size2 = GetBmpSize(icons[i]); if (size2.x > iconSize.x) iconSize = size2; if (!align_icon) { size1.x += size2.x + (text_off ? 0 : 5); @@ -317,7 +327,7 @@ void DropDown::messureSize() wxSize szContent = textSize; szContent.x += 10; if (check_bitmap.bmp().IsOk()) { - auto szBmp = check_bitmap.bmp().GetSize(); + auto szBmp = check_bitmap.GetBmpSize(); szContent.x += szBmp.x + 5; } if (iconSize.x > 0) szContent.x += iconSize.x + (text_off ? 0 : 5); diff --git a/src/slic3r/GUI/Widgets/StateColor.cpp b/src/slic3r/GUI/Widgets/StateColor.cpp index 25b9d5b7a..5145669de 100644 --- a/src/slic3r/GUI/Widgets/StateColor.cpp +++ b/src/slic3r/GUI/Widgets/StateColor.cpp @@ -37,6 +37,7 @@ static std::map gDarkColors{ {"#D7E8DE", "#1F2B27"}, {"#2B3436", "#808080"}, {"#ABABAB", "#ABABAB"}, + {"#D9D9D9", "#2D2D32"}, //{"#F0F0F0", "#3E3E44"}, };