mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
FIX: fix display of long filename in preview-only hint
Change-Id: Ib365a39b262cbf03b14eeefa64e3e46d1b48306e
This commit is contained in:
parent
b77e96acdd
commit
a3730b9236
3 changed files with 24 additions and 1 deletions
|
@ -667,6 +667,25 @@ void ConfirmBeforeSendDialog::update_btn_label(wxString ok_btn_text, wxString ca
|
|||
rescale();
|
||||
}
|
||||
|
||||
wxString ConfirmBeforeSendDialog::format_text(wxString str, int warp)
|
||||
{
|
||||
Label st (this, str);
|
||||
wxString out_txt = str;
|
||||
wxString count_txt = "";
|
||||
int new_line_pos = 0;
|
||||
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
auto text_size = st.GetTextExtent(count_txt);
|
||||
if (text_size.x < warp) {
|
||||
count_txt += str[i];
|
||||
} else {
|
||||
out_txt.insert(i - 1, '\n');
|
||||
count_txt = "";
|
||||
}
|
||||
}
|
||||
return out_txt;
|
||||
}
|
||||
|
||||
ConfirmBeforeSendDialog::~ConfirmBeforeSendDialog()
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue