diff --git a/resources/images/advanced_option1_disable.svg b/resources/images/advanced_option1_disable.svg new file mode 100644 index 000000000..bcc2ce481 --- /dev/null +++ b/resources/images/advanced_option1_disable.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index fb2d1ce3d..ee4de4b61 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -581,21 +581,18 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater) - auto advanced_options_title = new Label(scroll_area, _L("Advanced Options")); - advanced_options_title->SetFont(::Label::Body_13); - advanced_options_title->SetForegroundColour(wxColour(38, 46, 48)); - + m_advanced_options_title = new Label(scroll_area, _L("Advanced Options")); + m_advanced_options_title->SetFont(::Label::Body_13); m_advanced_options_icon = new wxStaticBitmap(scroll_area, wxID_ANY, create_scaled_bitmap("advanced_option1", scroll_area, 18), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18))); - sizer_advanced_options_title->Add(m_hyperlink, 0, wxALIGN_CENTER, 0); 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_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) { + m_advanced_options_title->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {SetCursor(wxCURSOR_HAND);}); + m_advanced_options_title->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {SetCursor(wxCURSOR_ARROW);}); + m_advanced_options_title->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { if (m_print_status == PrintStatusUnsupportedPrinter) { m_options_other->Hide(); } else { @@ -1843,6 +1840,8 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vectorSetForegroundColour(wxColour(38, 46, 48)); + m_advanced_options_icon->SetBitmap(create_scaled_bitmap("advanced_option1", this, 18)); + } else { + m_advanced_options_title->SetForegroundColour(0xCECECE); + m_advanced_options_icon->SetBitmap(create_scaled_bitmap("advanced_option1_disable", this, 18)); + } +} + void SelectMachineDialog::on_selection_changed(wxCommandEvent &event) { /* reset timeout and reading printer info */ @@ -2973,6 +2983,8 @@ void SelectMachineDialog::on_selection_changed(wxCommandEvent &event) m_change_filament_times_sizer->Show(false); m_txt_change_filament_times->Show(false); + enable_advanced_option(true); + auto selection = m_comboBox_printer->GetSelection(); DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); if (!dev) return; diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index bfe294fb4..918a4500d 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -370,6 +370,7 @@ protected: Label* m_txt_change_filament_times{ nullptr }; Label* m_text_printer_msg{ nullptr }; Label* m_text_printer_msg_tips{ nullptr }; + Label* m_advanced_options_title{ nullptr }; wxStaticText* m_staticText_bed_title{ nullptr }; wxStaticText* m_stext_sending{ nullptr }; wxStaticText* m_statictext_finish{nullptr}; @@ -463,7 +464,8 @@ public: void set_default_from_sdcard(); void update_page_turn_state(bool show); void on_timer(wxTimerEvent& event); - void on_selection_changed(wxCommandEvent& event); + void enable_advanced_option(bool en); + void on_selection_changed(wxCommandEvent &event); void update_flow_cali_check(MachineObject* obj); void Enable_Refresh_Button(bool en); void Enable_Send_Button(bool en);