mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 10:02:12 +00:00
ENH: advance part skip dialog
Jira: [STUDIO-12687] Change-Id: Ie6805c57f478ae5a10f81b49dc5a4e45fb40dbc7 (cherry picked from commit 8ed17efc32f8c635dc50e27bf7146fd2eb70941d)
This commit is contained in:
@@ -233,12 +233,6 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
|
||||
|
||||
bSizer_task_name->Add(task_name_panel, 0, wxEXPAND, FromDIP(5));
|
||||
|
||||
|
||||
/* wxFlexGridSizer *fgSizer_task = new wxFlexGridSizer(2, 2, 0, 0);
|
||||
fgSizer_task->AddGrowableCol(0);
|
||||
fgSizer_task->SetFlexibleDirection(wxVERTICAL);
|
||||
fgSizer_task->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);*/
|
||||
|
||||
m_printing_stage_value = new wxStaticText(parent, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT | wxST_ELLIPSIZE_END);
|
||||
m_printing_stage_value->Wrap(-1);
|
||||
m_printing_stage_value->SetMaxSize(wxSize(FromDIP(800),-1));
|
||||
@@ -261,18 +255,12 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
|
||||
|
||||
m_staticText_profile_value->SetForegroundColour(0x6B6B6B);
|
||||
|
||||
auto progress_lr_panel = new wxPanel(parent, wxID_ANY);
|
||||
progress_lr_panel->SetBackgroundColour(*wxWHITE);
|
||||
|
||||
auto m_panel_progress = new wxPanel(parent, wxID_ANY);
|
||||
m_panel_progress->SetBackgroundColour(*wxWHITE);
|
||||
auto m_sizer_progressbar = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_gauge_progress = new ProgressBar(m_panel_progress, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize);
|
||||
m_gauge_progress = new ProgressBar(progress_lr_panel, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize);
|
||||
m_gauge_progress->SetValue(0);
|
||||
m_gauge_progress->SetHeight(PROGRESSBAR_HEIGHT);
|
||||
m_gauge_progress->SetMaxSize(wxSize(FromDIP(600), -1));
|
||||
m_panel_progress->SetSizer(m_sizer_progressbar);
|
||||
m_panel_progress->Layout();
|
||||
m_panel_progress->SetSize(wxSize(-1, FromDIP(24)));
|
||||
m_panel_progress->SetMaxSize(wxSize(-1, FromDIP(24)));
|
||||
|
||||
wxBoxSizer *bSizer_task_btn = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
@@ -281,8 +269,9 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
|
||||
StateColor white_bg(std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Disabled), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Pressed),
|
||||
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Hovered), std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Enabled),
|
||||
std::pair<wxColour, int>(wxColour(255, 255, 255), StateColor::Normal));
|
||||
m_button_partskip = new Button(m_panel_progress, "");
|
||||
m_button_partskip = new Button(progress_lr_panel, "");
|
||||
m_button_partskip->Enable(false);
|
||||
m_button_partskip->Hide();
|
||||
m_button_partskip->SetBackgroundColor(white_bg);
|
||||
m_button_partskip->SetIcon("print_control_partskip_disable");
|
||||
m_button_partskip->SetBorderColor(*wxWHITE);
|
||||
@@ -292,7 +281,7 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
|
||||
m_button_partskip->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { m_button_partskip->SetIcon("print_control_partskip"); });
|
||||
m_button_partskip->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { m_button_partskip->SetIcon("print_control_partskip"); });
|
||||
|
||||
m_button_pause_resume = new ScalableButton(m_panel_progress, wxID_ANY, "print_control_pause", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER,true);
|
||||
m_button_pause_resume = new ScalableButton(progress_lr_panel, wxID_ANY, "print_control_pause", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER,true);
|
||||
|
||||
m_button_pause_resume->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
|
||||
if (m_button_pause_resume->GetToolTipText() == _L("Pause")) {
|
||||
@@ -315,7 +304,7 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
|
||||
}
|
||||
});
|
||||
|
||||
m_button_abort = new ScalableButton(m_panel_progress, wxID_ANY, "print_control_stop", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
|
||||
m_button_abort = new ScalableButton(progress_lr_panel, wxID_ANY, "print_control_stop", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
|
||||
m_button_abort->SetToolTip(_L("Stop"));
|
||||
|
||||
m_button_abort->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
|
||||
@@ -326,14 +315,6 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
|
||||
m_button_abort->SetBitmap_("print_control_stop"); }
|
||||
);
|
||||
|
||||
m_sizer_progressbar->Add(m_gauge_progress, 1, wxALIGN_CENTER_VERTICAL, 0);
|
||||
m_sizer_progressbar->Add(0, 0, 0, wxEXPAND|wxLEFT, FromDIP(18));
|
||||
m_sizer_progressbar->Add(m_button_partskip, 0, wxALL, FromDIP(5));
|
||||
m_sizer_progressbar->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
|
||||
m_sizer_progressbar->Add(m_button_pause_resume, 0, wxALL, FromDIP(5));
|
||||
m_sizer_progressbar->Add(0, 0, 0, wxEXPAND|wxLEFT, FromDIP(18));
|
||||
m_sizer_progressbar->Add(m_button_abort, 0, wxALL, FromDIP(5));
|
||||
|
||||
wxBoxSizer *bSizer_buttons = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer *bSizer_text = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxPanel* penel_bottons = new wxPanel(parent);
|
||||
@@ -380,48 +361,55 @@ void PrintingTaskPanel::create_panel(wxWindow* parent)
|
||||
wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
|
||||
m_staticText_progress_end->SetForegroundColour(wxColour(146, 146, 146));
|
||||
|
||||
//fgSizer_task->Add(bSizer_buttons, 0, wxEXPAND, 0);
|
||||
//fgSizer_task->Add(0, 0, 0, wxEXPAND, FromDIP(5));
|
||||
|
||||
wxPanel* panel_button_block = new wxPanel(penel_bottons, wxID_ANY);
|
||||
panel_button_block->SetMinSize(wxSize(TASK_BUTTON_SIZE.x * 2 + FromDIP(5) * 4, -1));
|
||||
panel_button_block->SetMinSize(wxSize(TASK_BUTTON_SIZE.x * 2 + FromDIP(5) * 4, -1));
|
||||
panel_button_block->SetSize(wxSize(TASK_BUTTON_SIZE.x * 2 + FromDIP(5) * 2, -1));
|
||||
panel_button_block->SetBackgroundColour(*wxWHITE);
|
||||
|
||||
m_staticText_layers = new wxStaticText(penel_text, wxID_ANY, _L("Layer: N/A"));
|
||||
m_staticText_layers->SetFont(wxFont(12, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("HarmonyOS Sans SC")));
|
||||
m_staticText_layers->SetForegroundColour(wxColour(146, 146, 146));
|
||||
m_staticText_layers->Hide();
|
||||
|
||||
//bSizer_text->Add(m_staticText_progress_percent, 0, wxALL, 0);
|
||||
bSizer_text->Add(sizer_percent, 0, wxEXPAND, 0);
|
||||
bSizer_text->Add(sizer_percent_icon, 0, wxEXPAND, 0);
|
||||
bSizer_text->Add(0, 0, 1, wxEXPAND, 0);
|
||||
bSizer_text->Add(m_staticText_layers, 0, wxALIGN_CENTER | wxALL, 0);
|
||||
bSizer_text->Add(m_staticText_layers, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0);
|
||||
bSizer_text->Add(0, 0, 0, wxLEFT, FromDIP(20));
|
||||
bSizer_text->Add(m_staticText_progress_left, 0, wxALIGN_CENTER | wxALL, 0);
|
||||
bSizer_text->Add(m_staticText_progress_left, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0);
|
||||
// Orca: display the end time of the print
|
||||
bSizer_text->Add(0, 0, 0, wxLEFT, FromDIP(8));
|
||||
bSizer_text->Add(m_staticText_progress_end, 0, wxALIGN_CENTER | wxALL, 0);
|
||||
|
||||
penel_text->SetMaxSize(wxSize(FromDIP(600), -1));
|
||||
// penel_text->SetMaxSize(wxSize(FromDIP(600), -1));
|
||||
penel_text->SetSizer(bSizer_text);
|
||||
penel_text->Layout();
|
||||
|
||||
bSizer_buttons->Add(penel_text, 1, wxEXPAND | wxALL, 0);
|
||||
bSizer_buttons->Add(panel_button_block, 0, wxALIGN_CENTER | wxALL, 0);
|
||||
auto progress_lr_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto progress_left_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
auto progress_right_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
penel_bottons->SetSizer(bSizer_buttons);
|
||||
penel_bottons->Layout();
|
||||
progress_left_sizer->Add(penel_text, 0, wxEXPAND | wxALL, 0);
|
||||
progress_left_sizer->Add(m_gauge_progress, 0, wxEXPAND | wxALL, 0);
|
||||
// progress_left_sizer->SetMaxSize(wxSize(FromDIP(600), -1));
|
||||
|
||||
progress_right_sizer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
|
||||
progress_right_sizer->Add(m_button_partskip, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(0));//5
|
||||
progress_right_sizer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
|
||||
progress_right_sizer->Add(m_button_pause_resume, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(0));
|
||||
progress_right_sizer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
|
||||
progress_right_sizer->Add(m_button_abort, 0, wxALL | wxALIGN_CENTER_VERTICAL, FromDIP(0));
|
||||
progress_right_sizer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(18));
|
||||
|
||||
progress_lr_sizer->Add(progress_left_sizer, 1, wxEXPAND | wxALL, 0);
|
||||
progress_lr_sizer->Add(progress_right_sizer, 0, wxEXPAND | wxALL , 0);
|
||||
|
||||
progress_lr_panel->SetSizer(progress_lr_sizer);
|
||||
progress_lr_panel->SetMaxSize(wxSize(FromDIP(720), -1));
|
||||
|
||||
progress_lr_panel->Layout();
|
||||
progress_lr_panel->Fit();
|
||||
|
||||
bSizer_subtask_info->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(14));
|
||||
bSizer_subtask_info->Add(bSizer_task_name, 0, wxEXPAND|wxRIGHT, FromDIP(18));
|
||||
bSizer_subtask_info->Add(m_staticText_profile_value, 0, wxEXPAND | wxTOP, FromDIP(5));
|
||||
bSizer_subtask_info->Add(m_printing_stage_value, 0, wxEXPAND | wxTOP, FromDIP(5));
|
||||
bSizer_subtask_info->Add(penel_bottons, 0, wxEXPAND | wxTOP, FromDIP(10));
|
||||
bSizer_subtask_info->Add(m_panel_progress, 0, wxEXPAND|wxRIGHT, FromDIP(25));
|
||||
|
||||
bSizer_subtask_info->Add(progress_lr_panel, 0, wxEXPAND | wxTOP, FromDIP(5));
|
||||
|
||||
m_printing_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
m_printing_sizer->SetMinSize(wxSize(PAGE_MIN_WIDTH, -1));
|
||||
@@ -660,6 +648,14 @@ void PrintingTaskPanel::update_machine_object(MachineObject* obj){
|
||||
|
||||
void PrintingTaskPanel::enable_partskip_button(bool enable)
|
||||
{
|
||||
if(m_obj){
|
||||
if( m_obj->is_support_partskip ){
|
||||
m_button_partskip->Show();
|
||||
}else{
|
||||
m_button_partskip->Hide();
|
||||
}
|
||||
}
|
||||
|
||||
if (!enable) {
|
||||
m_button_partskip->Enable(false);
|
||||
m_button_partskip->SetLabel("");
|
||||
|
||||
Reference in New Issue
Block a user