ENH:Add numerical display in AMS control

jira: STUDIO-10432
Change-Id: I504e38612b09513247462974b4d34b331a5d3240
(cherry picked from commit 3f51f72a66b8b88744512c4a7aa2069116572a76)
This commit is contained in:
zhou.xu
2025-02-14 18:09:47 +08:00
committed by Noisyfox
parent d5661a89e6
commit 296a8bc474
3 changed files with 19 additions and 3 deletions

View File

@@ -402,12 +402,13 @@ void MaterialSyncItem::render(wxDC &dc)
if (mcolor.Alpha() == 0) { material_name_colour = wxColour(0x26, 0x2E, 0x30); }
dc.SetTextForeground(material_name_colour);
if (dc.GetTextExtent(m_material_name).x > GetSize().x - 10) {
auto full_text = m_material_index + " " + m_material_name;
if (dc.GetTextExtent(full_text).x > GetSize().x - 10) {
dc.SetFont(::Label::Body_10);
}
auto material_txt_size = dc.GetTextExtent(m_material_name);
dc.DrawText(m_material_name, wxPoint((GetSize().x - material_txt_size.x) / 2, ((float) GetSize().y * 2 / 5 - material_txt_size.y) / 2));
auto material_txt_size = dc.GetTextExtent(full_text);
dc.DrawText(full_text, wxPoint((GetSize().x - material_txt_size.x) / 2, ((float) GetSize().y * 2 / 5 - material_txt_size.y) / 2));
int real_left_offset = get_real_offset();
if (m_match) {
dc.SetTextForeground(StateColor::darkModeColorFor(wxColour(0x26, 0x2E, 0x30)));
@@ -539,6 +540,10 @@ void MaterialSyncItem::doRender(wxDC &dc)
//not draw m_ams_not_match
}
void MaterialSyncItem::set_material_index_str(std::string str) {
m_material_index = str;
}
AmsMapingPopup::AmsMapingPopup(wxWindow *parent, bool use_in_sync_dialog) :
PopupWindow(parent, wxBORDER_NONE), m_use_in_sync_dialog(use_in_sync_dialog)
{