diff --git a/src/slic3r/GUI/BBLStatusBar.cpp b/src/slic3r/GUI/BBLStatusBar.cpp index e0cde171cc..9e755c356c 100644 --- a/src/slic3r/GUI/BBLStatusBar.cpp +++ b/src/slic3r/GUI/BBLStatusBar.cpp @@ -117,6 +117,11 @@ void BBLStatusBar::set_range(int val) } } +void BBLStatusBar::clear_percent() +{ + +} + void BBLStatusBar::show_progress(bool show) { if (show) { diff --git a/src/slic3r/GUI/BBLStatusBar.hpp b/src/slic3r/GUI/BBLStatusBar.hpp index 09bd20139e..ec3864193b 100644 --- a/src/slic3r/GUI/BBLStatusBar.hpp +++ b/src/slic3r/GUI/BBLStatusBar.hpp @@ -44,6 +44,7 @@ public: void set_progress(int) override; int get_range() const override; void set_range(int = 100) override; + void clear_percent() override; void show_progress(bool); void start_busy(int = 100); void stop_busy(); diff --git a/src/slic3r/GUI/BBLStatusBarBind.cpp b/src/slic3r/GUI/BBLStatusBarBind.cpp index 727ceb8d6a..2117e60794 100644 --- a/src/slic3r/GUI/BBLStatusBarBind.cpp +++ b/src/slic3r/GUI/BBLStatusBarBind.cpp @@ -92,6 +92,11 @@ void BBLStatusBarBind::set_range(int val) } } +void BBLStatusBarBind::clear_percent() +{ + +} + void BBLStatusBarBind::show_progress(bool show) { if (show) { diff --git a/src/slic3r/GUI/BBLStatusBarBind.hpp b/src/slic3r/GUI/BBLStatusBarBind.hpp index 37755aaec1..e30fff085c 100644 --- a/src/slic3r/GUI/BBLStatusBarBind.hpp +++ b/src/slic3r/GUI/BBLStatusBarBind.hpp @@ -47,6 +47,7 @@ public: void set_progress(int) override; int get_range() const override; void set_range(int = 100) override; + void clear_percent() override; void show_progress(bool); void start_busy(int = 100); void stop_busy(); diff --git a/src/slic3r/GUI/BBLStatusBarSend.cpp b/src/slic3r/GUI/BBLStatusBarSend.cpp index 242cc11e1f..3ca178d67e 100644 --- a/src/slic3r/GUI/BBLStatusBarSend.cpp +++ b/src/slic3r/GUI/BBLStatusBarSend.cpp @@ -105,6 +105,7 @@ void BBLStatusBarSend::set_progress(int val) } m_prog->SetValue(val); set_percent_text(wxString::Format("%d%%", val)); + m_sizer->Layout(); } @@ -120,6 +121,11 @@ void BBLStatusBarSend::set_range(int val) } } +void BBLStatusBarSend::clear_percent() +{ + set_percent_text(wxEmptyString); +} + void BBLStatusBarSend::show_progress(bool show) { if (show) { @@ -278,7 +284,6 @@ void BBLStatusBarSend::reset() set_percent_text(wxString::Format("%d%%", 0)); } - void BBLStatusBarSend::set_font(const wxFont &font) { m_self->SetFont(font); diff --git a/src/slic3r/GUI/BBLStatusBarSend.hpp b/src/slic3r/GUI/BBLStatusBarSend.hpp index d1e24aa08f..75b5cbeab5 100644 --- a/src/slic3r/GUI/BBLStatusBarSend.hpp +++ b/src/slic3r/GUI/BBLStatusBarSend.hpp @@ -48,6 +48,7 @@ public: void set_progress(int) override; int get_range() const override; void set_range(int = 100) override; + void clear_percent() override; void show_progress(bool); void start_busy(int = 100); void stop_busy(); @@ -71,7 +72,6 @@ public: bool is_slice_info_shown(); bool update_status(wxString &msg, bool &was_cancel, int percent = -1, bool yield = true); void reset(); - // Temporary methods to satisfy Perl side void show_cancel_button(); void hide_cancel_button(); diff --git a/src/slic3r/GUI/Jobs/Job.cpp b/src/slic3r/GUI/Jobs/Job.cpp index 7dca5aa9f3..8224285cf3 100644 --- a/src/slic3r/GUI/Jobs/Job.cpp +++ b/src/slic3r/GUI/Jobs/Job.cpp @@ -30,6 +30,11 @@ void GUI::Job::update_status(int st, const wxString &msg) wxQueueEvent(this, evt); } +void GUI::Job::update_percent_finish() +{ + m_progress->clear_percent(); +} + GUI::Job::Job(std::shared_ptr pri) : m_progress(std::move(pri)) { diff --git a/src/slic3r/GUI/Jobs/Job.hpp b/src/slic3r/GUI/Jobs/Job.hpp index 41d12fb368..4041e498f2 100644 --- a/src/slic3r/GUI/Jobs/Job.hpp +++ b/src/slic3r/GUI/Jobs/Job.hpp @@ -45,6 +45,8 @@ protected: // status update, to be used from the work thread (process() method) void update_status(int st, const wxString &msg = ""); + void update_percent_finish(); + bool was_canceled() const { return m_canceled.load(); } // Launched just before start(), a job can use it to prepare internals diff --git a/src/slic3r/GUI/Jobs/NotificationProgressIndicator.cpp b/src/slic3r/GUI/Jobs/NotificationProgressIndicator.cpp index cb71705687..e9f957e4f3 100644 --- a/src/slic3r/GUI/Jobs/NotificationProgressIndicator.cpp +++ b/src/slic3r/GUI/Jobs/NotificationProgressIndicator.cpp @@ -5,6 +5,11 @@ namespace Slic3r { namespace GUI { NotificationProgressIndicator::NotificationProgressIndicator(NotificationManager *nm): m_nm{nm} {} +void NotificationProgressIndicator::clear_percent() +{ + +} + void NotificationProgressIndicator::set_range(int range) { m_nm->progress_indicator_set_range(range); diff --git a/src/slic3r/GUI/Jobs/NotificationProgressIndicator.hpp b/src/slic3r/GUI/Jobs/NotificationProgressIndicator.hpp index 6b03af69df..388bfea935 100644 --- a/src/slic3r/GUI/Jobs/NotificationProgressIndicator.hpp +++ b/src/slic3r/GUI/Jobs/NotificationProgressIndicator.hpp @@ -14,6 +14,7 @@ public: explicit NotificationProgressIndicator(NotificationManager *nm); + void clear_percent() override; void set_range(int range) override; void set_cancel_callback(CancelFn = CancelFn()) override; void set_progress(int pr) override; diff --git a/src/slic3r/GUI/Jobs/PrintJob.cpp b/src/slic3r/GUI/Jobs/PrintJob.cpp index bbeee83aa3..e5a5f59cf5 100644 --- a/src/slic3r/GUI/Jobs/PrintJob.cpp +++ b/src/slic3r/GUI/Jobs/PrintJob.cpp @@ -216,6 +216,7 @@ void PrintJob::process() } else if (stage == BBL::SendingPrintJobStage::PrintingStageFinished) { msg = wxString::Format(_L("Successfully sent. Will automatically jump to the device page in %s s"), info); + this->update_percent_finish(); } else { if (this->connection_type == "lan") { msg = _L("Sending print job over LAN"); diff --git a/src/slic3r/GUI/Jobs/ProgressIndicator.hpp b/src/slic3r/GUI/Jobs/ProgressIndicator.hpp index 674a81ba26..b029fa762a 100644 --- a/src/slic3r/GUI/Jobs/ProgressIndicator.hpp +++ b/src/slic3r/GUI/Jobs/ProgressIndicator.hpp @@ -17,6 +17,7 @@ public: virtual ~ProgressIndicator() = default; + virtual void clear_percent() = 0; virtual void set_range(int range) = 0; virtual void set_cancel_callback(CancelFn = CancelFn()) = 0; virtual void set_progress(int pr) = 0; diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index 35e59680a1..4e3ce2d6c6 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -388,7 +388,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons m_button_ok = new Button(this, _L("Confirm")); m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetBorderColor(*wxWHITE); - m_button_ok->SetTextColor(*wxWHITE); + m_button_ok->SetTextColor(wxColour("#FFFFFE")); m_button_ok->SetFont(Label::Body_12); m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24))); m_button_ok->SetMinSize(wxSize(-1, FromDIP(24))); @@ -399,7 +399,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons e.SetEventObject(this); GetEventHandler()->ProcessEvent(evt); this->on_hide(); - }); + }); m_button_cancel = new Button(this, _L("Cancel")); m_button_cancel->SetBackgroundColor(btn_bg_white); @@ -512,6 +512,172 @@ void SecondaryCheckDialog::on_dpi_changed(const wxRect& suggested_rect) } void SecondaryCheckDialog::rescale() +{ + m_button_ok->Rescale(); + m_button_cancel->Rescale(); +} + +ConfirmBeforeSendDialog::ConfirmBeforeSendDialog(wxWindow* parent, wxWindowID id, const wxString& title, enum ButtonStyle btn_style, const wxPoint& pos, const wxSize& size, long style, bool not_show_again_check) + :DPIDialog(parent, id, title, pos, size, style) +{ + std::string icon_path = (boost::format("%1%/images/BambuStudioTitle.ico") % resources_dir()).str(); + SetIcon(wxIcon(encode_path(icon_path.c_str()), wxBITMAP_TYPE_ICO)); + + SetBackgroundColour(*wxWHITE); + m_sizer_main = new wxBoxSizer(wxVERTICAL); + auto m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(480), 1)); + m_line_top->SetBackgroundColour(wxColour(166, 169, 170)); + m_sizer_main->Add(m_line_top, 0, wxEXPAND, 0); + m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(5)); + + wxBoxSizer* m_sizer_right = new wxBoxSizer(wxVERTICAL); + + m_sizer_right->Add(0, 0, 1, wxTOP, FromDIP(15)); + + m_vebview_release_note = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL); + m_vebview_release_note->SetScrollRate(0, 5); + m_vebview_release_note->SetBackgroundColour(wxColour(0xF8, 0xF8, 0xF8)); + m_vebview_release_note->SetMinSize(wxSize(FromDIP(280), FromDIP(280))); + m_sizer_right->Add(m_vebview_release_note, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(35)); + + + auto bottom_sizer = new wxBoxSizer(wxVERTICAL); + auto sizer_button = new wxBoxSizer(wxHORIZONTAL); + StateColor btn_bg_green(std::pair(wxColour(27, 136, 68), StateColor::Pressed), std::pair(wxColour(61, 203, 115), StateColor::Hovered), + std::pair(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal)); + + StateColor btn_bg_white(std::pair(wxColour(206, 206, 206), StateColor::Pressed), std::pair(wxColour(238, 238, 238), StateColor::Hovered), + std::pair(*wxWHITE, StateColor::Normal)); + + + if (not_show_again_check) { + m_show_again_checkbox = new wxCheckBox(this, wxID_ANY, _L("Don't show again"), wxDefaultPosition, wxDefaultSize, 0); + m_show_again_checkbox->Bind(wxEVT_COMMAND_CHECKBOX_CLICKED, [this](wxCommandEvent& e) { + not_show_again = !not_show_again; + m_show_again_checkbox->SetValue(not_show_again); + }); + bottom_sizer->Add(m_show_again_checkbox, 0, wxALL, FromDIP(5)); + } + m_button_ok = new Button(this, _L("Confirm")); + m_button_ok->SetBackgroundColor(btn_bg_green); + m_button_ok->SetBorderColor(*wxWHITE); + m_button_ok->SetTextColor(wxColour("#FFFFFE")); + m_button_ok->SetFont(Label::Body_12); + m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24))); + m_button_ok->SetMinSize(wxSize(-1, FromDIP(24))); + m_button_ok->SetCornerRadius(FromDIP(12)); + + m_button_ok->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { + wxCommandEvent evt(EVT_SECONDARY_CHECK_CONFIRM, GetId()); + e.SetEventObject(this); + GetEventHandler()->ProcessEvent(evt); + this->on_hide(); + }); + + m_button_cancel = new Button(this, _L("Cancel")); + m_button_cancel->SetBackgroundColor(btn_bg_white); + m_button_cancel->SetBorderColor(wxColour(38, 46, 48)); + m_button_cancel->SetFont(Label::Body_12); + m_button_cancel->SetSize(wxSize(FromDIP(58), FromDIP(24))); + m_button_cancel->SetMinSize(wxSize(-1, FromDIP(24))); + m_button_cancel->SetCornerRadius(FromDIP(12)); + + m_button_cancel->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent& e) { + wxCommandEvent evt(EVT_SECONDARY_CHECK_CANCEL); + e.SetEventObject(this); + GetEventHandler()->ProcessEvent(evt); + this->on_hide(); + }); + + if (btn_style != CONFIRM_AND_CANCEL) + m_button_cancel->Hide(); + else + m_button_cancel->Show(); + + sizer_button->AddStretchSpacer(); + sizer_button->Add(m_button_ok, 0, wxALL, FromDIP(5)); + sizer_button->Add(m_button_cancel, 0, wxALL, FromDIP(5)); + bottom_sizer->Add(sizer_button, 0, wxEXPAND | wxRIGHT | wxLEFT, 0); + + + m_sizer_right->Add(bottom_sizer, 0, wxEXPAND | wxRIGHT | wxLEFT, FromDIP(35)); + m_sizer_right->Add(0, 0, 0, wxTOP, FromDIP(18)); + + Bind(wxEVT_CLOSE_WINDOW, [this](auto& e) {this->on_hide(); }); + + SetSizer(m_sizer_right); + Layout(); + m_sizer_main->Fit(this); + + CenterOnParent(); + wxGetApp().UpdateDlgDarkUI(this); +} + +void ConfirmBeforeSendDialog::update_text(wxString text) +{ + wxBoxSizer* sizer_text_release_note = new wxBoxSizer(wxVERTICAL); + auto m_staticText_release_note = new Label(m_vebview_release_note, text); + m_staticText_release_note->Wrap(FromDIP(260)); + m_staticText_release_note->SetSize(wxSize(FromDIP(260), -1)); + m_staticText_release_note->SetMaxSize(wxSize(FromDIP(260), -1)); + m_staticText_release_note->SetMinSize(wxSize(FromDIP(260), -1)); + + wxBoxSizer* top_blank_sizer = new wxBoxSizer(wxVERTICAL); + wxBoxSizer* bottom_blank_sizer = new wxBoxSizer(wxVERTICAL); + top_blank_sizer->Add(FromDIP(5), 0, wxALIGN_CENTER | wxALL, FromDIP(5)); + bottom_blank_sizer->Add(FromDIP(5), 0, wxALIGN_CENTER | wxALL, FromDIP(5)); + + sizer_text_release_note->Add(top_blank_sizer, 0, wxALIGN_CENTER | wxALL, FromDIP(5)); + sizer_text_release_note->Add(m_staticText_release_note, 0, wxALIGN_CENTER, FromDIP(5)); + sizer_text_release_note->Add(bottom_blank_sizer, 0, wxALIGN_CENTER | wxALL, FromDIP(5)); + m_vebview_release_note->SetSizer(sizer_text_release_note); + auto text_size = m_staticText_release_note->GetSize(); + if (text_size.y < FromDIP(280)) + m_vebview_release_note->SetMinSize(wxSize(FromDIP(280), text_size.y + FromDIP(25))); + else + m_vebview_release_note->SetMinSize(wxSize(FromDIP(300), FromDIP(280))); + + m_vebview_release_note->Layout(); + m_sizer_main->Layout(); + m_sizer_main->Fit(this); +} + +void ConfirmBeforeSendDialog::on_show() +{ + wxGetApp().UpdateDlgDarkUI(this); + // recover button color + wxMouseEvent evt_ok(wxEVT_LEFT_UP); + m_button_ok->GetEventHandler()->ProcessEvent(evt_ok); + wxMouseEvent evt_cancel(wxEVT_LEFT_UP); + m_button_cancel->GetEventHandler()->ProcessEvent(evt_cancel); + this->ShowModal(); +} + +void ConfirmBeforeSendDialog::on_hide() +{ + if (m_show_again_checkbox != nullptr && not_show_again && show_again_config_text != "") + wxGetApp().app_config->set(show_again_config_text, "1"); + EndModal(wxID_OK); +} + +void ConfirmBeforeSendDialog::update_btn_label(wxString ok_btn_text, wxString cancel_btn_text) +{ + m_button_ok->SetLabel(ok_btn_text); + m_button_cancel->SetLabel(cancel_btn_text); + rescale(); +} + +ConfirmBeforeSendDialog::~ConfirmBeforeSendDialog() +{ + +} + +void ConfirmBeforeSendDialog::on_dpi_changed(const wxRect& suggested_rect) +{ + rescale(); +} + +void ConfirmBeforeSendDialog::rescale() { m_button_ok->Rescale(); m_button_cancel->Rescale(); diff --git a/src/slic3r/GUI/ReleaseNote.hpp b/src/slic3r/GUI/ReleaseNote.hpp index 5b2dae6adc..a62c310692 100644 --- a/src/slic3r/GUI/ReleaseNote.hpp +++ b/src/slic3r/GUI/ReleaseNote.hpp @@ -116,6 +116,41 @@ public: std::string show_again_config_text = ""; }; +class ConfirmBeforeSendDialog : public DPIDialog +{ +public: + enum ButtonStyle { + ONLY_CONFIRM = 0, + CONFIRM_AND_CANCEL = 1, + MAX_STYLE_NUM = 2 + }; + ConfirmBeforeSendDialog( + wxWindow* parent, + wxWindowID id = wxID_ANY, + const wxString& title = wxEmptyString, + enum ButtonStyle btn_style = CONFIRM_AND_CANCEL, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxCLOSE_BOX | wxCAPTION, + bool not_show_again_check = false + ); + void update_text(wxString text); + void on_show(); + void on_hide(); + void update_btn_label(wxString ok_btn_text, wxString cancel_btn_text); + void rescale(); + ~ConfirmBeforeSendDialog(); + void on_dpi_changed(const wxRect& suggested_rect); + + wxBoxSizer* m_sizer_main; + wxScrolledWindow* m_vebview_release_note{ nullptr }; + Button* m_button_ok; + Button* m_button_cancel; + wxCheckBox* m_show_again_checkbox; + bool not_show_again = false; + std::string show_again_config_text = ""; +}; + }} // namespace Slic3r::GUI #endif diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 01fbd680a1..dfda213414 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -1934,11 +1934,9 @@ bool SelectMachineDialog::is_same_printer_model() void SelectMachineDialog::show_errors(wxString &info) { - if (confirm_dlg == nullptr) { - confirm_dlg = new SecondaryCheckDialog(this, wxID_ANY, _L("Errors")); - } - confirm_dlg->update_text(info); - confirm_dlg->on_show(); + ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Errors")); + confirm_dlg.update_text(info); + confirm_dlg.on_show(); } void SelectMachineDialog::on_ok_btn(wxCommandEvent &event) @@ -2008,12 +2006,11 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event) if (!is_same_printer_type || has_slice_warnings) { wxString confirm_title = _L("Warning"); - if (confirm_dlg == nullptr) { - confirm_dlg = new SecondaryCheckDialog(this, wxID_ANY, confirm_title); - confirm_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent &e) { - this->on_ok(); - }); - } + ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, confirm_title); + confirm_dlg.Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, &confirm_dlg](wxCommandEvent& e) { + confirm_dlg.on_hide(); + this->on_ok(); + }); wxString info_msg = wxEmptyString; for (auto i = 0; i < confirm_text.size(); i++) { @@ -2025,8 +2022,8 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event) } } - confirm_dlg->update_text(info_msg); - confirm_dlg->on_show(); + confirm_dlg.update_text(info_msg); + confirm_dlg.on_show(); } else { this->on_ok(); @@ -3093,9 +3090,6 @@ bool SelectMachineDialog::Show(bool show) SelectMachineDialog::~SelectMachineDialog() { delete m_refresh_timer; - - if (confirm_dlg != nullptr) - delete confirm_dlg; } void SelectMachineDialog::update_lan_machine_list() diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index 5ca62b942a..454b16df40 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -282,7 +282,7 @@ private: wxColour m_colour_def_color{wxColour(255, 255, 255)}; wxColour m_colour_bold_color{wxColour(38, 46, 48)}; - SecondaryCheckDialog* confirm_dlg = nullptr; + //SecondaryCheckDialog* confirm_dlg = nullptr; protected: MaterialHash m_materialList; diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 7294d77815..68e9b22703 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -2805,9 +2805,11 @@ void StatusPanel::set_hold_count(int& count) void StatusPanel::on_sys_color_changed() { + m_button_abort->msw_rescale(); m_bitmap_speed.msw_rescale(); m_bitmap_speed_active.msw_rescale(); m_switch_speed->SetImages(m_bitmap_speed, m_bitmap_speed); + m_ams_control->msw_rescale(); } void StatusPanel::msw_rescale() diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index b2a0ff54a9..c19b753c79 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -660,28 +660,57 @@ void AMSLib::doRender(wxDC &dc) int height = size.y - FromDIP(8); int curr_height = height * float(m_info.material_remain * 1.0 / 100.0); - if (curr_height < FromDIP(6)) { - curr_height = FromDIP(6); - } + int top = height - curr_height; - dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), curr_height, m_radius); + + if (curr_height >= FromDIP(6)) { +#ifdef __APPLE__ + dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), curr_height, m_radius); +#else + dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), curr_height, m_radius - 1); +#endif + + + } if (top > 2) { - dc.DrawRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), FromDIP(2)); - if (tmp_lib_colour.Red() > 238 && tmp_lib_colour.Green() > 238 && tmp_lib_colour.Blue() > 238) { - dc.SetPen(wxPen(wxColour(130, 129, 128), 1, wxSOLID)); + if (curr_height >= FromDIP(6)) { + dc.DrawRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), FromDIP(2)); + if (tmp_lib_colour.Red() > 238 && tmp_lib_colour.Green() > 238 && tmp_lib_colour.Blue() > 238) { + dc.SetPen(wxPen(wxColour(130, 129, 128), 1, wxSOLID)); + dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); + dc.DrawLine(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(4), FromDIP(4) + top); + } + } + else { dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); - dc.DrawLine(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(4), FromDIP(4) + top); + if (tmp_lib_colour.Red() > 238 && tmp_lib_colour.Green() > 238 && tmp_lib_colour.Blue() > 238) { + dc.SetPen(wxPen(wxColour(130, 129, 128), 2, wxSOLID)); + } + else { + dc.SetPen(wxPen(tmp_lib_colour, 2, wxSOLID)); + } + +#ifdef __APPLE__ + dc.DrawLine(FromDIP(5), FromDIP(4) + height - FromDIP(2), size.x - FromDIP(5), FromDIP(4) + height - FromDIP(2)); + dc.DrawLine(FromDIP(6), FromDIP(4) + height - FromDIP(1), size.x - FromDIP(6), FromDIP(4) + height - FromDIP(1)); +#else + dc.DrawLine(FromDIP(4), FromDIP(4) + height - FromDIP(2), size.x - FromDIP(4), FromDIP(4) + height - FromDIP(2)); + dc.DrawLine(FromDIP(5), FromDIP(4) + height - FromDIP(1), size.x - FromDIP(5), FromDIP(4) + height - FromDIP(1)); +#endif } } - - //border dc.SetPen(wxPen(wxColour(130, 130, 128), 1, wxSOLID)); dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); - dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4), size.x - FromDIP(8), size.y - FromDIP(8), m_radius); +#ifdef __APPLE__ + dc.DrawRoundedRectangle(FromDIP(4), FromDIP(4), size.x - FromDIP(7), size.y - FromDIP(7), m_radius); +#else + dc.DrawRoundedRectangle(FromDIP(3), FromDIP(3), size.x - FromDIP(6), size.y - FromDIP(6), m_radius); +#endif + // edit icon if (m_info.material_state != AMSCanType::AMS_CAN_TYPE_EMPTY && m_info.material_state != AMSCanType::AMS_CAN_TYPE_NONE) @@ -1852,6 +1881,8 @@ void AMSControl::msw_rescale() m_button_ams_setting_normal.msw_rescale(); m_button_ams_setting_hover.msw_rescale(); m_button_ams_setting_press.msw_rescale(); + m_button_ams_setting->SetBitmap(m_button_ams_setting_normal.bmp()); + m_extruder->msw_rescale(); m_button_extruder_back->SetMinSize(wxSize(-1, FromDIP(24))); m_button_extruder_feed->SetMinSize(wxSize(-1, FromDIP(24)));