diff --git a/resources/images/round.svg b/resources/images/round.svg new file mode 100644 index 000000000..74e8ce243 --- /dev/null +++ b/resources/images/round.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/slic3r/GUI/Widgets/TempInput.cpp b/src/slic3r/GUI/Widgets/TempInput.cpp index fad9925fc..134a335a2 100644 --- a/src/slic3r/GUI/Widgets/TempInput.cpp +++ b/src/slic3r/GUI/Widgets/TempInput.cpp @@ -126,8 +126,7 @@ void TempInput::Create(wxWindow *parent, wxString text, wxString label, wxString text_ctrl->SetForegroundColour(StateColor::darkModeColorFor(*wxBLACK)); if (!normal_icon.IsEmpty()) { this->normal_icon = ScalableBitmap(this, normal_icon.ToStdString(), 16); } if (!actice_icon.IsEmpty()) { this->actice_icon = ScalableBitmap(this, actice_icon.ToStdString(), 16); } - this->left_icon = ScalableBitmap(this, "L", 16); - this->right_icon = ScalableBitmap(this, "R", 16); + this->round_scale_hint_icon = ScalableBitmap(this, "round", 16); this->degree_icon = ScalableBitmap(this, "degree", 16); messureSize(); } @@ -310,8 +309,7 @@ void TempInput::Rescale() { if (this->normal_icon.bmp().IsOk()) this->normal_icon.msw_rescale(); if (this->degree_icon.bmp().IsOk()) this->degree_icon.msw_rescale(); - if (this->left_icon.bmp().IsOk()) this->left_icon.msw_rescale(); - if (this->right_icon.bmp().IsOk()) this->right_icon.msw_rescale(); + if (this->round_scale_hint_icon.bmp().IsOk()) this->round_scale_hint_icon.msw_rescale(); messureSize(); } @@ -356,7 +354,7 @@ void TempInput::DoSetSize(int x, int y, int width, int height, int sizeFlags) left += 9; if (m_input_type == TEMP_OF_MAIN_NOZZLE_TYPE || m_input_type == TEMP_OF_DEPUTY_NOZZLE_TYPE) { - wxSize szIcon = left_icon.GetBmpSize(); + wxSize szIcon = round_scale_hint_icon.GetBmpSize(); left += szIcon.x + 3; } @@ -434,10 +432,13 @@ void TempInput::render(wxDC &dc) } pt.x += szIcon.x + 9; - if (left_icon.bmp().IsOk() && m_input_type == TEMP_OF_DEPUTY_NOZZLE_TYPE){ - wxSize szIcon = left_icon.GetBmpSize(); + + ScalableBitmap round_icon(this, "round", 16);/*icon diffs in normal and dark mode*/ + round_icon.msw_rescale(); + if (round_icon.bmp().IsOk() && m_input_type == TEMP_OF_DEPUTY_NOZZLE_TYPE){ + wxSize szIcon = round_icon.GetBmpSize(); pt.y = (size.y - szIcon.y) / 2; - dc.DrawBitmap(left_icon.bmp(), pt); + dc.DrawBitmap(round_icon.bmp(), pt); dc.SetFont(::Label::Body_12); auto sepSize = dc.GetMultiLineTextExtent(wxString("L")); @@ -449,10 +450,10 @@ void TempInput::render(wxDC &dc) pt.x += szIcon.x + 3; } - if (right_icon.bmp().IsOk() && m_input_type == TEMP_OF_MAIN_NOZZLE_TYPE) { - wxSize szIcon = right_icon.GetBmpSize(); + if (round_icon.bmp().IsOk() && m_input_type == TEMP_OF_MAIN_NOZZLE_TYPE) { + wxSize szIcon = round_icon.GetBmpSize(); pt.y = (size.y - szIcon.y) / 2; - dc.DrawBitmap(right_icon.bmp(), pt); + dc.DrawBitmap(round_icon.bmp(), pt); dc.SetFont(::Label::Body_12); auto sepSize = dc.GetMultiLineTextExtent(wxString("R")); @@ -531,7 +532,7 @@ void TempInput::messureMiniSize() width += 9; if (m_input_type == TEMP_OF_MAIN_NOZZLE_TYPE || m_input_type == TEMP_OF_DEPUTY_NOZZLE_TYPE) { - wxSize szIcon = left_icon.GetBmpSize(); + wxSize szIcon = round_scale_hint_icon.GetBmpSize(); width += szIcon.x; } width += 3; @@ -591,7 +592,7 @@ void TempInput::messureSize() width += 9; if (m_input_type == TEMP_OF_MAIN_NOZZLE_TYPE || m_input_type == TEMP_OF_DEPUTY_NOZZLE_TYPE) { - wxSize szIcon = left_icon.GetBmpSize(); + wxSize szIcon = round_scale_hint_icon.GetBmpSize(); width += szIcon.x; } width += 3; diff --git a/src/slic3r/GUI/Widgets/TempInput.hpp b/src/slic3r/GUI/Widgets/TempInput.hpp index 68986cecf..b7d129bf4 100644 --- a/src/slic3r/GUI/Widgets/TempInput.hpp +++ b/src/slic3r/GUI/Widgets/TempInput.hpp @@ -23,9 +23,7 @@ class TempInput : public wxNavigationEnabled ScalableBitmap normal_icon; ScalableBitmap actice_icon; ScalableBitmap degree_icon; - - ScalableBitmap left_icon; - ScalableBitmap right_icon; + ScalableBitmap round_scale_hint_icon;/*the size hint of icon, use to compute size*/ StateColor label_color; StateColor text_color;