FIX:reslove polish translation cover other select use tooltips

jira:[STUDIO-15128]

Change-Id: I148eaa6245b18359597c3b96f205639ae66bbc8a
(cherry picked from commit 3eb422faaf99956001941839c4dd2b55235d3053)
(cherry picked from commit 4a65fef5dc7cf3cfe312d7ed3706d9ff5b6ee58d)
This commit is contained in:
milk
2025-10-20 12:01:29 +08:00
committed by Noisyfox
parent 1aad85aee4
commit b2dd9aa196
2 changed files with 27 additions and 0 deletions

View File

@@ -4690,6 +4690,7 @@ void SelectMachineDialog::UpdateStatusCheckWarning_ExtensionTool(MachineObject*
m_ops = ops;
m_param = param;
m_full_title = title;
SetBackgroundColour(StateColor::darkModeColorFor(*wxWHITE));
wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
@@ -4697,6 +4698,8 @@ void SelectMachineDialog::UpdateStatusCheckWarning_ExtensionTool(MachineObject*
m_printoption_title = new Label(this, title);
m_printoption_title->SetFont(Label::Body_13);
update_title_display();
m_printoption_tips = new ScalableButton(this, wxID_ANY, "icon_qusetion", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
m_printoption_tips->SetMinSize(wxSize(FromDIP(18), FromDIP(18)));
m_printoption_tips->SetMaxSize(wxSize(FromDIP(18), FromDIP(18)));
@@ -4819,10 +4822,32 @@ int PrintOption::getValueInt()
}
}
void PrintOption::update_title_display()
{
if (!m_printoption_title || m_full_title.IsEmpty()) {
return;
}
wxGCDC dc;
wxSize titleSize = dc.GetTextExtent(m_full_title);
int maxTitleWidth = FromDIP(150);
wxString displayTitle = m_full_title;
if (titleSize.x > maxTitleWidth) {
displayTitle = wxControl::Ellipsize(m_full_title, dc, wxELLIPSIZE_END, maxTitleWidth);
m_printoption_title->SetToolTip(m_full_title);
} else {
m_printoption_title->SetToolTip(wxEmptyString);
}
m_printoption_title->SetLabel(displayTitle);
}
void PrintOption::msw_rescale()
{
m_printoption_item->msw_rescale();
m_printoption_tips->msw_rescale();
update_title_display();
}
PrintOptionItem::PrintOptionItem(wxWindow* parent, std::vector<POItem> ops, std::string param)