match style of progress dialog

This commit is contained in:
yw4z
2026-09-10 17:02:29 +03:00
parent 29b3282c8b
commit d09c3568c5
3 changed files with 10 additions and 7 deletions

View File

@@ -107,12 +107,12 @@ private:
const wxString& title,
const wxString& message,
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)
{
const auto alive = m_alive;
wxProgressDialog* progress = new wxProgressDialog(title, message, maximum, this, style);
wxTimer* timer = new wxTimer();
ProgressDialog* progress = new ProgressDialog(title, message, maximum, this, style);
wxTimer* timer = new wxTimer();
timer->Bind(wxEVT_TIMER, [alive, progress, message](wxTimerEvent&) {
if (alive->load(std::memory_order_acquire) && progress)

View File

@@ -178,7 +178,7 @@ bool ProgressDialog::Create(const wxString &title, const wxString &message, int
wxBoxSizer *sizer_1line = new wxBoxSizer(wxHORIZONTAL);
m_msg = new wxStaticText(m_panel_1line, wxID_ANY, wxEmptyString, wxDefaultPosition, PROGRESSDIALOG_SIMPLEBOOK_SIZE, 0);
m_msg->Wrap(-1);
m_msg->SetFont(::Label::Body_13);
m_msg->SetFont(::Label::Body_14);
m_msg->SetForegroundColour(PROGRESSDIALOG_GREY_700);
sizer_1line->Add(m_msg, 0, wxALIGN_CENTER, 0);
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);
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->SetFont(::Label::Body_13);
m_msg_2line->SetFont(::Label::Body_14);
m_msg_2line->SetForegroundColour(PROGRESSDIALOG_GREY_700);
m_msg_2line->SetMaxSize(wxSize(PROGRESSDIALOG_SIMPLEBOOK_SIZE.x, -1));
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->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_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)) {
m_gauge = new wxGauge(this, wxID_ANY, maximum, wxDefaultPosition, PROGRESSDIALOG_GAUGE_SIZE, gauge_style);
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));
}

View File

@@ -18,7 +18,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
#define PROGRESSDIALOG_GAUGE_SIZE wxSize(FromDIP(320), FromDIP(6))
#define PROGRESSDIALOG_CANCEL_BUTTON_SIZE wxSize(FromDIP(60), FromDIP(24))
#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