ENH:Picture text adaptive height for combobox menu

jira: STUDIO-11330
Change-Id: I5948dad4811747258b96e6ac1bf95379640c9cd4
This commit is contained in:
zhou.xu 2025-04-03 17:17:01 +08:00 committed by lane.wei
parent b7ffba39e4
commit 4824f1f5ce
1 changed files with 2 additions and 1 deletions

View File

@ -26,7 +26,7 @@
#include "BitmapComboBox.hpp" #include "BitmapComboBox.hpp"
#include "Widgets/StaticBox.hpp" #include "Widgets/StaticBox.hpp"
#include "Widgets/Label.hpp" #include "Widgets/Label.hpp"
#include "../Utils/WxFontUtils.hpp"
#ifndef __linux__ #ifndef __linux__
// msw_menuitem_bitmaps is used for MSW and OSX // msw_menuitem_bitmaps is used for MSW and OSX
static std::map<int, std::string> msw_menuitem_bitmaps; static std::map<int, std::string> msw_menuitem_bitmaps;
@ -583,6 +583,7 @@ wxBitmap *get_extruder_color_icon(std::string color, std::string label, int icon
wxMemoryDC dc(&cdc); wxMemoryDC dc(&cdc);
#endif #endif
dc.SetFont(::Label::Body_12); dc.SetFont(::Label::Body_12);
Slic3r::GUI::WxFontUtils::get_suitable_font_size(icon_height - 2, dc);
dc.SelectObject(*bitmap); dc.SelectObject(*bitmap);
if (clr.Alpha() == 0) { if (clr.Alpha() == 0) {
int size = icon_height * 2; int size = icon_height * 2;