FIX:fixed some issue with send print and ams ui

Change-Id: I1a37bad6ec1f193f9fd98c74506b3bb0358ece6d
This commit is contained in:
tao wang 2022-12-06 18:08:29 +08:00 committed by Lane.Wei
parent 67c2f5a285
commit 0db1b52b23
18 changed files with 292 additions and 32 deletions

View file

@ -117,6 +117,11 @@ void BBLStatusBar::set_range(int val)
} }
} }
void BBLStatusBar::clear_percent()
{
}
void BBLStatusBar::show_progress(bool show) void BBLStatusBar::show_progress(bool show)
{ {
if (show) { if (show) {

View file

@ -44,6 +44,7 @@ public:
void set_progress(int) override; void set_progress(int) override;
int get_range() const override; int get_range() const override;
void set_range(int = 100) override; void set_range(int = 100) override;
void clear_percent() override;
void show_progress(bool); void show_progress(bool);
void start_busy(int = 100); void start_busy(int = 100);
void stop_busy(); void stop_busy();

View file

@ -92,6 +92,11 @@ void BBLStatusBarBind::set_range(int val)
} }
} }
void BBLStatusBarBind::clear_percent()
{
}
void BBLStatusBarBind::show_progress(bool show) void BBLStatusBarBind::show_progress(bool show)
{ {
if (show) { if (show) {

View file

@ -47,6 +47,7 @@ public:
void set_progress(int) override; void set_progress(int) override;
int get_range() const override; int get_range() const override;
void set_range(int = 100) override; void set_range(int = 100) override;
void clear_percent() override;
void show_progress(bool); void show_progress(bool);
void start_busy(int = 100); void start_busy(int = 100);
void stop_busy(); void stop_busy();

View file

@ -105,6 +105,7 @@ void BBLStatusBarSend::set_progress(int val)
} }
m_prog->SetValue(val); m_prog->SetValue(val);
set_percent_text(wxString::Format("%d%%", val)); set_percent_text(wxString::Format("%d%%", val));
m_sizer->Layout(); 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) void BBLStatusBarSend::show_progress(bool show)
{ {
if (show) { if (show) {
@ -278,7 +284,6 @@ void BBLStatusBarSend::reset()
set_percent_text(wxString::Format("%d%%", 0)); set_percent_text(wxString::Format("%d%%", 0));
} }
void BBLStatusBarSend::set_font(const wxFont &font) void BBLStatusBarSend::set_font(const wxFont &font)
{ {
m_self->SetFont(font); m_self->SetFont(font);

View file

@ -48,6 +48,7 @@ public:
void set_progress(int) override; void set_progress(int) override;
int get_range() const override; int get_range() const override;
void set_range(int = 100) override; void set_range(int = 100) override;
void clear_percent() override;
void show_progress(bool); void show_progress(bool);
void start_busy(int = 100); void start_busy(int = 100);
void stop_busy(); void stop_busy();
@ -71,7 +72,6 @@ public:
bool is_slice_info_shown(); bool is_slice_info_shown();
bool update_status(wxString &msg, bool &was_cancel, int percent = -1, bool yield = true); bool update_status(wxString &msg, bool &was_cancel, int percent = -1, bool yield = true);
void reset(); void reset();
// Temporary methods to satisfy Perl side // Temporary methods to satisfy Perl side
void show_cancel_button(); void show_cancel_button();
void hide_cancel_button(); void hide_cancel_button();

View file

@ -30,6 +30,11 @@ void GUI::Job::update_status(int st, const wxString &msg)
wxQueueEvent(this, evt); wxQueueEvent(this, evt);
} }
void GUI::Job::update_percent_finish()
{
m_progress->clear_percent();
}
GUI::Job::Job(std::shared_ptr<ProgressIndicator> pri) GUI::Job::Job(std::shared_ptr<ProgressIndicator> pri)
: m_progress(std::move(pri)) : m_progress(std::move(pri))
{ {

View file

@ -45,6 +45,8 @@ protected:
// status update, to be used from the work thread (process() method) // status update, to be used from the work thread (process() method)
void update_status(int st, const wxString &msg = ""); void update_status(int st, const wxString &msg = "");
void update_percent_finish();
bool was_canceled() const { return m_canceled.load(); } bool was_canceled() const { return m_canceled.load(); }
// Launched just before start(), a job can use it to prepare internals // Launched just before start(), a job can use it to prepare internals

View file

@ -5,6 +5,11 @@ namespace Slic3r { namespace GUI {
NotificationProgressIndicator::NotificationProgressIndicator(NotificationManager *nm): m_nm{nm} {} NotificationProgressIndicator::NotificationProgressIndicator(NotificationManager *nm): m_nm{nm} {}
void NotificationProgressIndicator::clear_percent()
{
}
void NotificationProgressIndicator::set_range(int range) void NotificationProgressIndicator::set_range(int range)
{ {
m_nm->progress_indicator_set_range(range); m_nm->progress_indicator_set_range(range);

View file

@ -14,6 +14,7 @@ public:
explicit NotificationProgressIndicator(NotificationManager *nm); explicit NotificationProgressIndicator(NotificationManager *nm);
void clear_percent() override;
void set_range(int range) override; void set_range(int range) override;
void set_cancel_callback(CancelFn = CancelFn()) override; void set_cancel_callback(CancelFn = CancelFn()) override;
void set_progress(int pr) override; void set_progress(int pr) override;

View file

@ -216,6 +216,7 @@ void PrintJob::process()
} }
else if (stage == BBL::SendingPrintJobStage::PrintingStageFinished) { else if (stage == BBL::SendingPrintJobStage::PrintingStageFinished) {
msg = wxString::Format(_L("Successfully sent. Will automatically jump to the device page in %s s"), info); msg = wxString::Format(_L("Successfully sent. Will automatically jump to the device page in %s s"), info);
this->update_percent_finish();
} else { } else {
if (this->connection_type == "lan") { if (this->connection_type == "lan") {
msg = _L("Sending print job over LAN"); msg = _L("Sending print job over LAN");

View file

@ -17,6 +17,7 @@ public:
virtual ~ProgressIndicator() = default; virtual ~ProgressIndicator() = default;
virtual void clear_percent() = 0;
virtual void set_range(int range) = 0; virtual void set_range(int range) = 0;
virtual void set_cancel_callback(CancelFn = CancelFn()) = 0; virtual void set_cancel_callback(CancelFn = CancelFn()) = 0;
virtual void set_progress(int pr) = 0; virtual void set_progress(int pr) = 0;

View file

@ -388,7 +388,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
m_button_ok = new Button(this, _L("Confirm")); m_button_ok = new Button(this, _L("Confirm"));
m_button_ok->SetBackgroundColor(btn_bg_green); m_button_ok->SetBackgroundColor(btn_bg_green);
m_button_ok->SetBorderColor(*wxWHITE); 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->SetFont(Label::Body_12);
m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24))); m_button_ok->SetSize(wxSize(FromDIP(58), FromDIP(24)));
m_button_ok->SetMinSize(wxSize(-1, FromDIP(24))); m_button_ok->SetMinSize(wxSize(-1, FromDIP(24)));
@ -399,7 +399,7 @@ SecondaryCheckDialog::SecondaryCheckDialog(wxWindow* parent, wxWindowID id, cons
e.SetEventObject(this); e.SetEventObject(this);
GetEventHandler()->ProcessEvent(evt); GetEventHandler()->ProcessEvent(evt);
this->on_hide(); this->on_hide();
}); });
m_button_cancel = new Button(this, _L("Cancel")); m_button_cancel = new Button(this, _L("Cancel"));
m_button_cancel->SetBackgroundColor(btn_bg_white); m_button_cancel->SetBackgroundColor(btn_bg_white);
@ -512,6 +512,172 @@ void SecondaryCheckDialog::on_dpi_changed(const wxRect& suggested_rect)
} }
void SecondaryCheckDialog::rescale() 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, int>(wxColour(27, 136, 68), StateColor::Pressed), std::pair<wxColour, int>(wxColour(61, 203, 115), StateColor::Hovered),
std::pair<wxColour, int>(AMS_CONTROL_BRAND_COLOUR, StateColor::Normal));
StateColor btn_bg_white(std::pair<wxColour, int>(wxColour(206, 206, 206), StateColor::Pressed), std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Hovered),
std::pair<wxColour, int>(*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_ok->Rescale();
m_button_cancel->Rescale(); m_button_cancel->Rescale();

View file

@ -116,6 +116,41 @@ public:
std::string show_again_config_text = ""; 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 }} // namespace Slic3r::GUI
#endif #endif

View file

@ -1934,11 +1934,9 @@ bool SelectMachineDialog::is_same_printer_model()
void SelectMachineDialog::show_errors(wxString &info) void SelectMachineDialog::show_errors(wxString &info)
{ {
if (confirm_dlg == nullptr) { ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Errors"));
confirm_dlg = new SecondaryCheckDialog(this, wxID_ANY, _L("Errors")); confirm_dlg.update_text(info);
} confirm_dlg.on_show();
confirm_dlg->update_text(info);
confirm_dlg->on_show();
} }
void SelectMachineDialog::on_ok_btn(wxCommandEvent &event) 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) { if (!is_same_printer_type || has_slice_warnings) {
wxString confirm_title = _L("Warning"); wxString confirm_title = _L("Warning");
if (confirm_dlg == nullptr) { ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, confirm_title);
confirm_dlg = new SecondaryCheckDialog(this, wxID_ANY, confirm_title); confirm_dlg.Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, &confirm_dlg](wxCommandEvent& e) {
confirm_dlg->Bind(EVT_SECONDARY_CHECK_CONFIRM, [this](wxCommandEvent &e) { confirm_dlg.on_hide();
this->on_ok(); this->on_ok();
}); });
}
wxString info_msg = wxEmptyString; wxString info_msg = wxEmptyString;
for (auto i = 0; i < confirm_text.size(); i++) { 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.update_text(info_msg);
confirm_dlg->on_show(); confirm_dlg.on_show();
} else { } else {
this->on_ok(); this->on_ok();
@ -3093,9 +3090,6 @@ bool SelectMachineDialog::Show(bool show)
SelectMachineDialog::~SelectMachineDialog() SelectMachineDialog::~SelectMachineDialog()
{ {
delete m_refresh_timer; delete m_refresh_timer;
if (confirm_dlg != nullptr)
delete confirm_dlg;
} }
void SelectMachineDialog::update_lan_machine_list() void SelectMachineDialog::update_lan_machine_list()

View file

@ -282,7 +282,7 @@ private:
wxColour m_colour_def_color{wxColour(255, 255, 255)}; wxColour m_colour_def_color{wxColour(255, 255, 255)};
wxColour m_colour_bold_color{wxColour(38, 46, 48)}; wxColour m_colour_bold_color{wxColour(38, 46, 48)};
SecondaryCheckDialog* confirm_dlg = nullptr; //SecondaryCheckDialog* confirm_dlg = nullptr;
protected: protected:
MaterialHash m_materialList; MaterialHash m_materialList;

View file

@ -2805,9 +2805,11 @@ void StatusPanel::set_hold_count(int& count)
void StatusPanel::on_sys_color_changed() void StatusPanel::on_sys_color_changed()
{ {
m_button_abort->msw_rescale();
m_bitmap_speed.msw_rescale(); m_bitmap_speed.msw_rescale();
m_bitmap_speed_active.msw_rescale(); m_bitmap_speed_active.msw_rescale();
m_switch_speed->SetImages(m_bitmap_speed, m_bitmap_speed); m_switch_speed->SetImages(m_bitmap_speed, m_bitmap_speed);
m_ams_control->msw_rescale();
} }
void StatusPanel::msw_rescale() void StatusPanel::msw_rescale()

View file

@ -660,28 +660,57 @@ void AMSLib::doRender(wxDC &dc)
int height = size.y - FromDIP(8); int height = size.y - FromDIP(8);
int curr_height = height * float(m_info.material_remain * 1.0 / 100.0); 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; 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) { if (top > 2) {
dc.DrawRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), FromDIP(2)); if (curr_height >= FromDIP(6)) {
if (tmp_lib_colour.Red() > 238 && tmp_lib_colour.Green() > 238 && tmp_lib_colour.Blue() > 238) { dc.DrawRectangle(FromDIP(4), FromDIP(4) + top, size.x - FromDIP(8), FromDIP(2));
dc.SetPen(wxPen(wxColour(130, 129, 128), 1, wxSOLID)); 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.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 //border
dc.SetPen(wxPen(wxColour(130, 130, 128), 1, wxSOLID)); dc.SetPen(wxPen(wxColour(130, 130, 128), 1, wxSOLID));
dc.SetBrush(wxBrush(*wxTRANSPARENT_BRUSH)); 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 // edit icon
if (m_info.material_state != AMSCanType::AMS_CAN_TYPE_EMPTY && m_info.material_state != AMSCanType::AMS_CAN_TYPE_NONE) 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_normal.msw_rescale();
m_button_ams_setting_hover.msw_rescale(); m_button_ams_setting_hover.msw_rescale();
m_button_ams_setting_press.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_extruder->msw_rescale();
m_button_extruder_back->SetMinSize(wxSize(-1, FromDIP(24))); m_button_extruder_back->SetMinSize(wxSize(-1, FromDIP(24)));
m_button_extruder_feed->SetMinSize(wxSize(-1, FromDIP(24))); m_button_extruder_feed->SetMinSize(wxSize(-1, FromDIP(24)));