mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-11 19:17:33 +00:00
match style of progress dialog
This commit is contained in:
@@ -107,12 +107,12 @@ private:
|
|||||||
const wxString& title,
|
const wxString& title,
|
||||||
const wxString& message,
|
const wxString& message,
|
||||||
int maximum = 100,
|
int maximum = 100,
|
||||||
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE,
|
int style = wxPD_APP_MODAL | wxPD_AUTO_HIDE, // | wxPD_CAN_ABORT for cancel button
|
||||||
bool finish_after_dialog_destroyed = false)
|
bool finish_after_dialog_destroyed = false)
|
||||||
{
|
{
|
||||||
const auto alive = m_alive;
|
const auto alive = m_alive;
|
||||||
wxProgressDialog* progress = new wxProgressDialog(title, message, maximum, this, style);
|
ProgressDialog* progress = new ProgressDialog(title, message, maximum, this, style);
|
||||||
wxTimer* timer = new wxTimer();
|
wxTimer* timer = new wxTimer();
|
||||||
|
|
||||||
timer->Bind(wxEVT_TIMER, [alive, progress, message](wxTimerEvent&) {
|
timer->Bind(wxEVT_TIMER, [alive, progress, message](wxTimerEvent&) {
|
||||||
if (alive->load(std::memory_order_acquire) && progress)
|
if (alive->load(std::memory_order_acquire) && progress)
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
|
|||||||
wxBoxSizer *sizer_1line = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *sizer_1line = new wxBoxSizer(wxHORIZONTAL);
|
||||||
m_msg = new wxStaticText(m_panel_1line, wxID_ANY, wxEmptyString, wxDefaultPosition, PROGRESSDIALOG_SIMPLEBOOK_SIZE, 0);
|
m_msg = new wxStaticText(m_panel_1line, wxID_ANY, wxEmptyString, wxDefaultPosition, PROGRESSDIALOG_SIMPLEBOOK_SIZE, 0);
|
||||||
m_msg->Wrap(-1);
|
m_msg->Wrap(-1);
|
||||||
m_msg->SetFont(::Label::Body_13);
|
m_msg->SetFont(::Label::Body_14);
|
||||||
m_msg->SetForegroundColour(PROGRESSDIALOG_GREY_700);
|
m_msg->SetForegroundColour(PROGRESSDIALOG_GREY_700);
|
||||||
sizer_1line->Add(m_msg, 0, wxALIGN_CENTER, 0);
|
sizer_1line->Add(m_msg, 0, wxALIGN_CENTER, 0);
|
||||||
m_panel_1line->SetSizer(sizer_1line);
|
m_panel_1line->SetSizer(sizer_1line);
|
||||||
@@ -188,7 +188,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
|
|||||||
wxBoxSizer *sizer_2line = new wxBoxSizer(wxVERTICAL);
|
wxBoxSizer *sizer_2line = new wxBoxSizer(wxVERTICAL);
|
||||||
m_msg_2line = new wxStaticText(m_panel_2line, wxID_ANY, wxEmptyString, wxDefaultPosition, PROGRESSDIALOG_SIMPLEBOOK_SIZE, 0);
|
m_msg_2line = new wxStaticText(m_panel_2line, wxID_ANY, wxEmptyString, wxDefaultPosition, PROGRESSDIALOG_SIMPLEBOOK_SIZE, 0);
|
||||||
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_14);
|
||||||
m_msg_2line->SetForegroundColour(PROGRESSDIALOG_GREY_700);
|
m_msg_2line->SetForegroundColour(PROGRESSDIALOG_GREY_700);
|
||||||
m_msg_2line->SetMaxSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, -1));
|
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);
|
||||||
@@ -204,7 +204,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
|
|||||||
|
|
||||||
m_msg = new wxStaticText(m_msg_scrolledWindow, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, -1), 0);
|
m_msg = new wxStaticText(m_msg_scrolledWindow, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, -1), 0);
|
||||||
m_msg->Wrap(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x);
|
m_msg->Wrap(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x);
|
||||||
m_msg->SetFont(::Label::Body_13);
|
m_msg->SetFont(::Label::Body_14);
|
||||||
m_msg->SetForegroundColour(PROGRESSDIALOG_GREY_700);
|
m_msg->SetForegroundColour(PROGRESSDIALOG_GREY_700);
|
||||||
|
|
||||||
m_msg_sizer->Add(m_msg, 0, wxEXPAND | wxALL, 0);
|
m_msg_sizer->Add(m_msg, 0, wxEXPAND | wxALL, 0);
|
||||||
@@ -228,6 +228,9 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
|
|||||||
if (!HasPDFlag(wxPD_NO_PROGRESS)) {
|
if (!HasPDFlag(wxPD_NO_PROGRESS)) {
|
||||||
m_gauge = new wxGauge(this, wxID_ANY, maximum, wxDefaultPosition, PROGRESSDIALOG_GAUGE_SIZE, gauge_style);
|
m_gauge = new wxGauge(this, wxID_ANY, maximum, wxDefaultPosition, PROGRESSDIALOG_GAUGE_SIZE, gauge_style);
|
||||||
m_gauge->SetValue(0);
|
m_gauge->SetValue(0);
|
||||||
|
m_gauge->SetForegroundColour(wxColour("#009688"));
|
||||||
|
m_gauge->SetBackgroundColour(wxColour("#D9D9D9"));
|
||||||
|
wxGetApp().UpdateDarkUI(m_gauge);
|
||||||
m_sizer_main->Add(m_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(28));
|
m_sizer_main->Add(m_gauge, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(28));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
|
|||||||
#define PROGRESSDIALOG_GAUGE_SIZE wxSize(FromDIP(320), FromDIP(6))
|
#define PROGRESSDIALOG_GAUGE_SIZE wxSize(FromDIP(320), FromDIP(6))
|
||||||
#define PROGRESSDIALOG_CANCEL_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
|
#define PROGRESSDIALOG_CANCEL_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
|
||||||
#define PROGRESSDIALOG_DEF_BK wxColour(255,255,255)
|
#define PROGRESSDIALOG_DEF_BK wxColour(255,255,255)
|
||||||
#define PROGRESSDIALOG_GREY_700 wxColour(107,107,107)
|
#define PROGRESSDIALOG_GREY_700 wxColour(54,54,54) // #363636 label color
|
||||||
|
|
||||||
#define wxPD_NO_PROGRESS 0x0100
|
#define wxPD_NO_PROGRESS 0x0100
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user