mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
FIX: the display of n3s humidity
jira: [STUDIO-14195] Change-Id: I6b49df928bdb1ce36450006805dd5d152ca7ad96 (cherry picked from commit 1e7cd2340c3c67a6a49e61dc7645428203d4df56)
This commit is contained in:
@@ -2848,7 +2848,9 @@ AMSHumidity::AMSHumidity(wxWindow* parent, wxWindowID id, AMSinfo info, const wx
|
||||
//wxWindow::SetBackgroundColour(AMS_CONTROL_DEF_HUMIDITY_BK_COLOUR);
|
||||
|
||||
Bind(wxEVT_LEFT_UP, [this](wxMouseEvent& e) {
|
||||
if (m_show_humidity) {
|
||||
|
||||
int humidity_display_idx = m_amsinfo.get_humidity_display_idx();
|
||||
if (1 <= humidity_display_idx && humidity_display_idx <= 5) {
|
||||
auto mouse_pos = ClientToScreen(e.GetPosition());
|
||||
auto rect = ClientToScreen(wxPoint(0, 0));
|
||||
|
||||
@@ -2938,11 +2940,10 @@ void AMSHumidity::doRender(wxDC& dc)
|
||||
|
||||
dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
|
||||
dc.SetBrush(wxBrush(StateColor::darkModeColorFor(AMS_CONTROL_DEF_BLOCK_BK_COLOUR)));
|
||||
// left mode
|
||||
if (m_amsinfo.ams_humidity >= 1 && m_amsinfo.ams_humidity <= 5) { m_show_humidity = true; }
|
||||
else { m_show_humidity = false; }
|
||||
|
||||
if (m_show_humidity) {
|
||||
// left mode
|
||||
int humidity_display_idx = m_amsinfo.get_humidity_display_idx();
|
||||
if (1 <= humidity_display_idx && humidity_display_idx <= 5) {
|
||||
//background
|
||||
dc.SetPen(wxPen(*wxTRANSPARENT_PEN));
|
||||
dc.SetBrush(wxBrush(StateColor::darkModeColorFor(AMS_CONTROL_DEF_BLOCK_BK_COLOUR)));
|
||||
@@ -2953,9 +2954,9 @@ void AMSHumidity::doRender(wxDC& dc)
|
||||
{
|
||||
ScalableBitmap hum_img;
|
||||
if (!wxGetApp().dark_mode()) {
|
||||
hum_img = ams_humidity_imgs[m_amsinfo.get_humidity_display_idx() - 1];
|
||||
hum_img = ams_humidity_imgs[humidity_display_idx - 1];
|
||||
} else {
|
||||
hum_img = ams_humidity_dark_imgs[m_amsinfo.get_humidity_display_idx() - 1];
|
||||
hum_img = ams_humidity_dark_imgs[humidity_display_idx - 1];
|
||||
}
|
||||
|
||||
pot = wxPoint((size.x - hum_img.GetBmpWidth()) / 2, ((size.y - hum_img.GetBmpSize().y) / 2));
|
||||
@@ -2967,9 +2968,9 @@ void AMSHumidity::doRender(wxDC& dc)
|
||||
// hum image
|
||||
ScalableBitmap hum_img;
|
||||
if (!wxGetApp().dark_mode()) {
|
||||
hum_img = ams_humidity_no_num_imgs[m_amsinfo.get_humidity_display_idx() - 1];
|
||||
hum_img = ams_humidity_no_num_imgs[humidity_display_idx - 1];
|
||||
} else {
|
||||
hum_img = ams_humidity_no_num_dark_imgs[m_amsinfo.get_humidity_display_idx() - 1];
|
||||
hum_img = ams_humidity_no_num_dark_imgs[humidity_display_idx - 1];
|
||||
}
|
||||
|
||||
pot = wxPoint(FromDIP(5), ((size.y - hum_img.GetBmpSize().y) / 2));
|
||||
|
||||
@@ -261,6 +261,7 @@ public:
|
||||
void parse_ext_info(MachineObject* obj, DevAmsTray tray);
|
||||
|
||||
bool support_drying() const { return (ams_type == AMSModel::N3S_AMS) || (ams_type == AMSModel::N3F_AMS); };
|
||||
bool support_humidity() const { return 1 <= get_humidity_display_idx() && get_humidity_display_idx() <= 5; }
|
||||
Caninfo get_caninfo(const std::string& can_id, bool& found) const;
|
||||
|
||||
int get_humidity_display_idx() const;
|
||||
@@ -739,9 +740,6 @@ public:
|
||||
ScalableBitmap ams_sun_img;
|
||||
ScalableBitmap ams_drying_img;
|
||||
|
||||
|
||||
int m_humidity = { 0 };
|
||||
bool m_show_humidity = { false };
|
||||
bool m_vams_loading{ false };
|
||||
AMSModel m_ams_model;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user