From ea0b202a633722b58c87e12a6f0fa10f151af173 Mon Sep 17 00:00:00 2001 From: "maosheng.wei" Date: Thu, 14 Dec 2023 16:58:21 +0800 Subject: [PATCH] FIX: Incomplete copy display in Transfer or discard dialog Jira: 5569 5549 Change-Id: I757b636259d7e1a222b9fc09276c12235360fd57 --- src/slic3r/GUI/PrintHostDialogs.cpp | 2 +- src/slic3r/GUI/UnsavedChangesDialog.cpp | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/PrintHostDialogs.cpp b/src/slic3r/GUI/PrintHostDialogs.cpp index cfaceb132..82693e6bc 100644 --- a/src/slic3r/GUI/PrintHostDialogs.cpp +++ b/src/slic3r/GUI/PrintHostDialogs.cpp @@ -117,7 +117,7 @@ PrintHostSendDialog::PrintHostSendDialog(const fs::path &path, PrintHostPostUplo }); } - add_button(wxID_CANCEL,false,"Cancel"); + add_button(wxID_CANCEL,false, _L("Cancel")); finalize(); #ifdef __linux__ diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 7d8432557..63e093332 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1601,6 +1601,14 @@ void UnsavedChangesDialog::update_list() m_scrolledWindow->SetSizer(m_listsizer); // m_scrolledWindow->Layout(); + wxSize text_size = m_action_line->GetTextExtent(m_action_line->GetLabel()); + int width = UNSAVE_CHANGE_DIALOG_ACTION_LINE_SIZE.GetWidth(); + // +2: Ensure that there is at least one line and that the content contains '\n' + int rows = int(text_size.GetWidth() / width) + 2; + int height = rows * text_size.GetHeight(); + m_action_line->SetMinSize(wxSize(width, height)); + Layout(); + Fit(); } std::string UnsavedChangesDialog::subreplace(std::string resource_str, std::string sub_str, std::string new_str)