mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -204,6 +204,7 @@ private:
|
||||
Label *m_printoption_title{nullptr};
|
||||
ScalableButton *m_printoption_tips{ nullptr };
|
||||
PrintOptionItem *m_printoption_item{nullptr};
|
||||
wxString m_full_title;
|
||||
|
||||
public:
|
||||
PrintOption(wxWindow *parent, wxString title, wxString tips, std::vector<POItem> ops, std::string param = "");
|
||||
@@ -221,6 +222,7 @@ public:
|
||||
bool contain_opt(const std::string& opt_str) const;
|
||||
void update_options(std::vector<POItem> ops, const wxString &tips);
|
||||
void update_tooltip(const wxString &tips);
|
||||
void update_title_display();
|
||||
|
||||
void msw_rescale();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user