ENH:Advanced option supports folding
jira:[none] Change-Id: I7017ea4a246b05d142e4a49d499d57e46f3c4428
This commit is contained in:
parent
22bb81e0cd
commit
eea4abe6b7
|
@ -1,10 +1,3 @@
|
|||
<svg width="7" height="13" viewBox="0 0 7 13" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_1_2)">
|
||||
<path d="M1.08203 11.6507L5.86724 6.86455C6.25771 6.47401 6.25768 5.8409 5.86718 5.4504L1.08203 0.66522" stroke="#262E30" stroke-linecap="round"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_1_2">
|
||||
<rect width="13" height="7" fill="white" transform="matrix(0 -1 1 0 0 13)"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M12.4742 9.15669C12.7353 9.41782 12.7353 9.84008 12.4742 10.0984L7.14038 15.435C6.87924 15.6961 6.45698 15.6961 6.19863 15.435C5.94027 15.1739 5.93749 14.7516 6.19863 14.4933L11.0602 9.63173L6.19585 4.76742C5.93472 4.50628 5.93472 4.08403 6.19585 3.82567C6.45698 3.56731 6.87924 3.56454 7.1376 3.82567L12.4742 9.15669Z" fill="#262E30"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 415 B After Width: | Height: | Size: 449 B |
|
@ -1,3 +1,3 @@
|
|||
<svg width="13" height="7" viewBox="0 0 13 7" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1.34937 1.08203L6.13547 5.86724C6.52601 6.25771 7.15912 6.25768 7.54962 5.86718L12.3348 1.08203" stroke="#262E30" stroke-linecap="round"/>
|
||||
<svg width="19" height="19" viewBox="0 0 19 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M10.0084 12.6962C9.74722 12.9574 9.32496 12.9574 9.0666 12.6962L3.73003 7.36244C3.4689 7.10131 3.4689 6.67905 3.73003 6.4207C3.99116 6.16234 4.41342 6.15956 4.67178 6.4207L9.53331 11.2822L14.3976 6.41792C14.6588 6.15678 15.081 6.15678 15.3394 6.41792C15.5977 6.67905 15.6005 7.10131 15.3394 7.35967L10.0084 12.6962Z" fill="#262E30"/>
|
||||
</svg>
|
||||
|
|
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 446 B |
|
@ -537,16 +537,36 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
auto advanced_options_title = new Label(this, _L("Advanced Options"));
|
||||
advanced_options_title->SetFont(::Label::Body_13);
|
||||
advanced_options_title->SetForegroundColour(wxColour(38, 46, 48));
|
||||
sizer_advanced_options_title->Add(0, 0, 1, wxEXPAND, 0);
|
||||
sizer_advanced_options_title->Add(advanced_options_title, 0, wxRIGHT, 0);
|
||||
|
||||
m_sizer_options = new wxBoxSizer(wxVERTICAL);
|
||||
m_advanced_options_icon = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("advanced_option1", this, 18), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)));
|
||||
|
||||
sizer_advanced_options_title->Add(0, 0, 1, wxEXPAND, 0);
|
||||
sizer_advanced_options_title->Add(advanced_options_title, 0, wxALIGN_CENTER, 0);
|
||||
sizer_advanced_options_title->Add(m_advanced_options_icon, 0, wxALIGN_CENTER, 0);
|
||||
|
||||
advanced_options_title->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {SetCursor(wxCURSOR_HAND);});
|
||||
advanced_options_title->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {SetCursor(wxCURSOR_ARROW);});
|
||||
advanced_options_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
|
||||
if (m_options_other->IsShown()) {
|
||||
m_options_other->Hide();
|
||||
m_advanced_options_icon->SetBitmap(create_scaled_bitmap("advanced_option1", this, 18));
|
||||
} else {
|
||||
m_options_other->Show();
|
||||
m_advanced_options_icon->SetBitmap(create_scaled_bitmap("advanced_option2", this, 18));
|
||||
}
|
||||
Layout();
|
||||
Fit();
|
||||
});
|
||||
|
||||
m_options_other = new wxPanel(this);
|
||||
m_sizer_options_timelapse = new wxBoxSizer(wxVERTICAL);
|
||||
m_sizer_options_other = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
|
||||
auto option_timelapse = new PrintOption(this, _L("Timelapse"), wxEmptyString, ops_no_auto, "timelapse");
|
||||
|
||||
auto option_auto_bed_level = new PrintOption(
|
||||
this,
|
||||
m_options_other,
|
||||
_L("Auto Bed Leveling"),
|
||||
_L("Check heatbed flatness. Leveling makes extruded height uniform.\n*Automatic mode: Level first (about 10 seconds). Skip if surface is fine."),
|
||||
ops_auto,
|
||||
|
@ -554,7 +574,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
);
|
||||
|
||||
auto option_flow_dynamics_cali = new PrintOption(
|
||||
this,
|
||||
m_options_other,
|
||||
_L("Flow Dynamics Calibration"),
|
||||
_L("Find the best coefficient for dynamic flow calibration to enhance print quality.\n*Automatic mode: Skip if the filament was calibrated recently."),
|
||||
ops_auto,
|
||||
|
@ -562,25 +582,29 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
);
|
||||
|
||||
auto option_nozzle_offset_cali_cali = new PrintOption(
|
||||
this,
|
||||
m_options_other,
|
||||
_L("Nozzle Offset Calibration"),
|
||||
_L("Calibrate nozzle offsets to enhance print quality.\n*Automatic mode: Check for calibration before printing; skip if unnecessary."),
|
||||
ops_auto
|
||||
);
|
||||
|
||||
auto option_use_ams = new PrintOption(
|
||||
this,
|
||||
m_options_other,
|
||||
_L("Use AMS"),
|
||||
_L("Calibrate nozzle offsets to enhance print quality.\n*Automatic mode: Check for calibration before printing; skip if unnecessary."),
|
||||
ops_no_auto
|
||||
);
|
||||
|
||||
option_use_ams->setValue("off");
|
||||
m_sizer_options->Add(option_timelapse, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options->Add(option_auto_bed_level, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options->Add(option_flow_dynamics_cali, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options->Add(option_nozzle_offset_cali_cali, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options->Add(option_use_ams, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_timelapse->Add(option_timelapse, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_auto_bed_level, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_flow_dynamics_cali, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_nozzle_offset_cali_cali, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
m_sizer_options_other->Add(option_use_ams, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
|
||||
m_options_other->SetSizer(m_sizer_options_other);
|
||||
m_options_other->Layout();
|
||||
m_options_other->Fit();
|
||||
|
||||
m_checkbox_list["timelapse"] = option_timelapse;
|
||||
m_checkbox_list["bed_leveling"] = option_auto_bed_level;
|
||||
|
@ -754,7 +778,8 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
m_sizer_main->Add(m_statictext_ams_msg, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, FromDIP(15));
|
||||
m_sizer_main->Add(sizer_split_options, 1, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
|
||||
m_sizer_main->Add(sizer_advanced_options_title, 1, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
|
||||
m_sizer_main->Add(m_sizer_options, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
|
||||
m_sizer_main->Add(m_sizer_options_timelapse, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
|
||||
m_sizer_main->Add(m_options_other, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
|
||||
m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10));
|
||||
m_sizer_main->Add(m_simplebook, 0, wxALIGN_CENTER_HORIZONTAL, 0);
|
||||
m_sizer_main->Add(m_sw_print_failed_info, 0, wxALIGN_CENTER, 0);
|
||||
|
@ -882,10 +907,6 @@ void SelectMachineDialog::popup_filament_backup()
|
|||
|
||||
void SelectMachineDialog::update_select_layout(MachineObject *obj)
|
||||
{
|
||||
if (m_printer_update_options_layout) {
|
||||
return;
|
||||
}
|
||||
|
||||
// reset checkbox
|
||||
m_checkbox_list["timelapse"]->Hide();
|
||||
m_checkbox_list["bed_leveling"]->Hide();
|
||||
|
@ -907,21 +928,14 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj)
|
|||
|
||||
if (obj && obj->is_support_auto_flow_calibration) {
|
||||
m_checkbox_list["flow_cali"]->Show();
|
||||
} else {
|
||||
m_checkbox_list["flow_cali"]->Hide();
|
||||
}
|
||||
|
||||
if (obj && obj->is_support_auto_leveling) {
|
||||
m_checkbox_list["bed_leveling"]->Show();
|
||||
} else {
|
||||
m_checkbox_list["bed_leveling"]->Hide();
|
||||
}
|
||||
|
||||
if (obj && obj->is_support_timelapse && is_show_timelapse()) {
|
||||
m_checkbox_list["timelapse"]->Show();
|
||||
update_timelapse_enable_status();
|
||||
} else {
|
||||
m_checkbox_list["timelapse"]->Hide();
|
||||
}
|
||||
|
||||
// load checkbox values from app config
|
||||
|
@ -944,14 +958,8 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj)
|
|||
|
||||
update_ams_check(obj);
|
||||
update_flow_cali_check(obj);
|
||||
|
||||
m_sizer_options->Layout();
|
||||
Layout();
|
||||
Fit();
|
||||
|
||||
if (obj->is_info_ready() && !m_printer_update_options_layout) {
|
||||
m_printer_update_options_layout = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SelectMachineDialog::prepare_mode(bool refresh_button)
|
||||
|
@ -2794,7 +2802,6 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event)
|
|||
m_ams_mapping_res = false;
|
||||
m_ams_mapping_valid = false;
|
||||
m_ams_mapping_result.clear();
|
||||
m_printer_update_options_layout = false;
|
||||
|
||||
auto selection = m_comboBox_printer->GetSelection();
|
||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
|
@ -4102,6 +4109,8 @@ void SelectMachineDialog::sys_color_changed()
|
|||
bool SelectMachineDialog::Show(bool show)
|
||||
{
|
||||
if (show) {
|
||||
m_options_other->Hide();
|
||||
m_advanced_options_icon->SetBitmap(create_scaled_bitmap("advanced_option1", this, 18));
|
||||
m_refresh_timer->Start(LIST_REFRESH_INTERVAL);
|
||||
} else {
|
||||
m_refresh_timer->Stop();
|
||||
|
@ -4507,21 +4516,23 @@ void PrintOptionItem::doRender(wxDC &dc)
|
|||
for (auto it = m_ops.begin(); it != m_ops.end(); ++it) {
|
||||
auto text_key = it->get_left();
|
||||
auto text_value = it->get_right();
|
||||
auto text_size = dc.GetTextExtent(text_value);
|
||||
|
||||
auto text_left = left + (FromDIP(50) - text_size.x) / 2;
|
||||
auto text_top = (size.y - text_size.y) / 2;
|
||||
|
||||
if (text_key == selected_key) {
|
||||
dc.SetPen(wxPen(0x00AE42));
|
||||
dc.SetTextForeground(0x00AE42);
|
||||
dc.SetFont(::Label::Head_13);
|
||||
auto text_size = dc.GetTextExtent(text_value);
|
||||
auto text_left = left + (FromDIP(50) - text_size.x) / 2;
|
||||
auto text_top = (size.y - text_size.y) / 2;
|
||||
dc.DrawText(text_value, wxPoint(text_left, text_top));
|
||||
}
|
||||
else {
|
||||
dc.SetPen(wxPen(*wxBLACK));
|
||||
dc.SetTextForeground(*wxBLACK);
|
||||
dc.SetFont(::Label::Body_13);
|
||||
auto text_size = dc.GetTextExtent(text_value);
|
||||
auto text_left = left + (FromDIP(50) - text_size.x) / 2;
|
||||
auto text_top = (size.y - text_size.y) / 2;
|
||||
dc.DrawText(text_value, wxPoint(text_left, text_top));
|
||||
}
|
||||
|
||||
|
|
|
@ -238,7 +238,6 @@ private:
|
|||
bool m_export_3mf_cancel{ false };
|
||||
bool m_is_canceled{ false };
|
||||
bool m_is_rename_mode{ false };
|
||||
bool m_printer_update_options_layout {false};
|
||||
PrintPageMode m_print_page_mode{PrintPageMode::PrintPageModePrepare};
|
||||
std::string m_print_error_msg;
|
||||
std::string m_print_error_extra;
|
||||
|
@ -281,7 +280,9 @@ protected:
|
|||
AmsTutorialPopup m_mapping_tutorial_popup{ nullptr };
|
||||
MaterialHash m_materialList;
|
||||
Plater * m_plater{nullptr};
|
||||
wxBoxSizer* m_sizer_options{ nullptr };
|
||||
wxPanel * m_options_other {nullptr};
|
||||
wxBoxSizer* m_sizer_options_timelapse{ nullptr };
|
||||
wxBoxSizer* m_sizer_options_other{ nullptr };
|
||||
wxBoxSizer* m_sizer_thumbnail{ nullptr };
|
||||
|
||||
wxBoxSizer* m_sizer_main{ nullptr };
|
||||
|
@ -326,6 +327,7 @@ protected:
|
|||
std::shared_ptr<PrintJob> m_print_job;
|
||||
wxScrolledWindow* m_sw_print_failed_info{nullptr};
|
||||
wxHyperlinkCtrl* m_hyperlink{nullptr};
|
||||
wxStaticBitmap * m_advanced_options_icon{nullptr};
|
||||
ScalableBitmap * rename_editable{nullptr};
|
||||
ScalableBitmap * rename_editable_light{nullptr};
|
||||
wxStaticBitmap * timeimg{nullptr};
|
||||
|
|
Loading…
Reference in New Issue