FIX: update the display of switch extruder

jira: [STUDIO-9746] [STUDIO-9359]
Change-Id: I12ce46c935883e5dba709576b944275af547d3dd
(cherry picked from commit 80b5e4f4d637d1daaebdc784ef2d8eb5a8e25193)
This commit is contained in:
xin.zhang
2025-01-13 14:12:26 +08:00
committed by Noisyfox
parent 622d11cd17
commit f97c9e3e7d
6 changed files with 81 additions and 19 deletions

View File

@@ -235,7 +235,7 @@ void SwitchBoard::doRender(wxDC &dc)
/*left*/
if (switch_left) {
dc.SetBrush(wxBrush(wxColour(0, 174, 66)));
is_enable ? dc.SetBrush(wxBrush(wxColour(0, 174, 66))) : dc.SetBrush(disable_color);
dc.DrawRoundedRectangle(0, 0, GetSize().x / 2, GetSize().y, 8);
}
@@ -285,9 +285,36 @@ void SwitchBoard::on_left_down(wxMouseEvent &evt)
switch_right = true;
index = 0;
}
if (auto_disable_when_switch)
{
is_enable = false;// make it disable while switching
}
Refresh();
wxCommandEvent event(wxCUSTOMEVT_SELECT_NOZZLE_POS);
event.SetInt(index);
wxPostEvent(this, event);
}
void SwitchBoard::Enable()
{
if (is_enable == true)
{
return;
}
is_enable = true;
Refresh();
}
void SwitchBoard::Disable()
{
if (is_enable == false)
{
return;
}
is_enable = false;
Refresh();
}