mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-29 22:43:15 +08:00
FIX: file name is not fully displayed if it is too long
Jira: STUDIO-5230 Signed-off-by: wenjie.guo <wenjie.guo@bambulab.com> Change-Id: I992fa0c0575afbd2eecb2af02c8a305eda028f7f (cherry picked from commit d0d7fb0b1394429ee9d28d8ef4060a286ba0112d)
This commit is contained in:
parent
70fbd02c53
commit
d15f49a7c0
@ -100,12 +100,14 @@ wxString ProgressDialog::FormatString(wxString title)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set mode
|
// set mode
|
||||||
if (m_mode == 0) {
|
if (m_mode == 0) {
|
||||||
m_simplebook->SetSelection(0);
|
m_simplebook->SetSelection(0);
|
||||||
m_msg->SetLabel(title);
|
m_msg->SetLabel(title);
|
||||||
} else {
|
} else {
|
||||||
|
wxSize content_size = m_msg->GetTextExtent(title);
|
||||||
|
int resized_height = (int(content_size.x / PROGRESSDIALOG_GAUGE_SIZE.x) + 1) * content_size.y;
|
||||||
|
set_panel_height(resized_height);
|
||||||
m_simplebook->SetSelection(1);
|
m_simplebook->SetSelection(1);
|
||||||
m_msg_2line->SetLabel(title);
|
m_msg_2line->SetLabel(title);
|
||||||
}
|
}
|
||||||
@ -188,7 +190,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
|
|||||||
m_msg_2line->Wrap(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x);
|
m_msg_2line->Wrap(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x);
|
||||||
m_msg_2line->SetFont(::Label::Body_13);
|
m_msg_2line->SetFont(::Label::Body_13);
|
||||||
m_msg_2line->SetForegroundColour(PROGRESSDIALOG_GREY_700);
|
m_msg_2line->SetForegroundColour(PROGRESSDIALOG_GREY_700);
|
||||||
m_msg_2line->SetMaxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE);
|
m_msg_2line->SetMaxSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, -1));
|
||||||
sizer_2line->Add(m_msg_2line, 1, wxALL, 0);
|
sizer_2line->Add(m_msg_2line, 1, wxALL, 0);
|
||||||
m_panel_2line->SetSizer(sizer_2line);
|
m_panel_2line->SetSizer(sizer_2line);
|
||||||
m_panel_2line->Layout();
|
m_panel_2line->Layout();
|
||||||
@ -684,6 +686,15 @@ void ProgressDialog::SetRange(int maximum)
|
|||||||
SetMaximum(maximum);
|
SetMaximum(maximum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProgressDialog::set_panel_height(int height) {
|
||||||
|
m_simplebook->SetSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, height));
|
||||||
|
m_simplebook->SetMinSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, height));
|
||||||
|
m_panel_2line->SetSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, height));
|
||||||
|
m_panel_2line->SetMinSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, height));
|
||||||
|
m_msg_2line->SetSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, height));
|
||||||
|
m_msg_2line->SetMinSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, height));
|
||||||
|
}
|
||||||
|
|
||||||
void ProgressDialog::SetMaximum(int maximum)
|
void ProgressDialog::SetMaximum(int maximum)
|
||||||
{
|
{
|
||||||
m_maximum = maximum;
|
m_maximum = maximum;
|
||||||
|
@ -47,7 +47,6 @@ public:
|
|||||||
virtual wxString GetMessage() const;
|
virtual wxString GetMessage() const;
|
||||||
|
|
||||||
virtual void SetRange(int maximum);
|
virtual void SetRange(int maximum);
|
||||||
|
|
||||||
// Return whether "Cancel" or "Skip" button was pressed, always return
|
// Return whether "Cancel" or "Skip" button was pressed, always return
|
||||||
// false if the corresponding button is not shown.
|
// false if the corresponding button is not shown.
|
||||||
virtual bool WasCancelled() const;
|
virtual bool WasCancelled() const;
|
||||||
@ -89,7 +88,6 @@ protected:
|
|||||||
// both this class and its derived classes that don't use m_gauge to
|
// both this class and its derived classes that don't use m_gauge to
|
||||||
// display progress.
|
// display progress.
|
||||||
void SetMaximum(int maximum);
|
void SetMaximum(int maximum);
|
||||||
|
|
||||||
// Return the labels to use for showing the elapsed/estimated/remaining
|
// Return the labels to use for showing the elapsed/estimated/remaining
|
||||||
// times respectively.
|
// times respectively.
|
||||||
static wxString GetElapsedLabel() { return wxGetTranslation("Elapsed time:"); }
|
static wxString GetElapsedLabel() { return wxGetTranslation("Elapsed time:"); }
|
||||||
@ -103,6 +101,7 @@ protected:
|
|||||||
// Return the progress dialog style. Prefer to use HasPDFlag() if possible.
|
// Return the progress dialog style. Prefer to use HasPDFlag() if possible.
|
||||||
int GetPDStyle() const { return m_pdStyle; }
|
int GetPDStyle() const { return m_pdStyle; }
|
||||||
void SetPDStyle(int pdStyle) { m_pdStyle = pdStyle; }
|
void SetPDStyle(int pdStyle) { m_pdStyle = pdStyle; }
|
||||||
|
void set_panel_height(int height);
|
||||||
|
|
||||||
// Updates estimated times from a given progress bar value and stores the
|
// Updates estimated times from a given progress bar value and stores the
|
||||||
// results in provided arguments.
|
// results in provided arguments.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user