PresetComboBox: Fixed thin/wide_space_icon_width scale

+ Added border for the color_extruder bitmaps
This commit is contained in:
YuSanka 2021-02-22 14:48:24 +01:00
parent 3fd36f08e0
commit f11e81517d
2 changed files with 6 additions and 4 deletions

View File

@ -397,8 +397,8 @@ void PresetComboBox::fill_width_height()
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;
thin_space_icon_width = lroundf(4 * scale_f);
wide_space_icon_width = lroundf(6 * scale_f);
}
wxString PresetComboBox::separator(const std::string& label)

View File

@ -467,6 +467,8 @@ std::vector<wxBitmap*> 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<wxBitmap*> 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);
}