mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-24 00:28:38 -07:00
FIX: the icon diffs in normal and dark display
jira: [STUDIO-9786] Change-Id: I935133161d3ecf09b72eb235bba335c5086e5674 (cherry picked from commit fed792d3794c28a2a80341e252e95d9db6a209ff)
This commit is contained in:
parent
2878eb50f1
commit
086da0d4a1
3 changed files with 18 additions and 16 deletions
3
resources/images/round.svg
Normal file
3
resources/images/round.svg
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="7.77482" cy="7.85898" r="7.70859" fill="#262E30"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 166 B |
|
|
@ -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();
|
||||
}
|
||||
|
|
@ -308,8 +307,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();
|
||||
}
|
||||
|
||||
|
|
@ -354,7 +352,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;
|
||||
}
|
||||
|
||||
|
|
@ -432,10 +430,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"));
|
||||
|
|
@ -447,10 +448,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"));
|
||||
|
|
@ -529,7 +530,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;
|
||||
|
|
@ -589,7 +590,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;
|
||||
|
|
|
|||
|
|
@ -23,9 +23,7 @@ class TempInput : public wxNavigationEnabled<StaticBox>
|
|||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue