diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 589b0a4d4..740b75367 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -2879,15 +2879,29 @@ void StatusPanel::on_switch_speed(wxCommandEvent &event) obj->command_set_printing_speed((PrintingSpeedLevel)this->speed_lvl); } }); - popUp->Bind(wxEVT_SHOW, [this](auto &e) { + popUp->Bind(wxEVT_SHOW, [this, popUp](auto &e) { if (!e.IsShown()) { - wxGetApp().CallAfter([popUp = e.GetEventObject()] { delete popUp; }); + /* wxGetApp().CallAfter([this, popUp] { + + });*/ + popUp->Destroy(); + m_showing_speed_popup = false; speed_dismiss_time = boost::posix_time::microsec_clock::universal_time(); } + }); + + m_ams_control->Bind(EVT_AMS_SHOW_HUMIDITY_TIPS, [this, popUp](auto& e) { + if (m_showing_speed_popup) { + if (popUp && popUp->IsShown()) { + popUp->Show(false); + } + } + e.Skip(); }); wxPoint pos = m_switch_speed->ClientToScreen(wxPoint(0, -6)); popUp->Position(pos, {0, m_switch_speed->GetSize().y + 12}); popUp->Popup(); + m_showing_speed_popup = true; } void StatusPanel::on_printing_fan_switch(wxCommandEvent &event) diff --git a/src/slic3r/GUI/StatusPanel.hpp b/src/slic3r/GUI/StatusPanel.hpp index 56028f4ac..21b7c214e 100644 --- a/src/slic3r/GUI/StatusPanel.hpp +++ b/src/slic3r/GUI/StatusPanel.hpp @@ -295,6 +295,7 @@ protected: int speed_lvl = 1; // 0 - 3 int speed_lvl_timeout {0}; boost::posix_time::ptime speed_dismiss_time; + bool m_showing_speed_popup = false; std::map img_list; // key: url, value: wxBitmap png Image std::map m_print_connect_types; diff --git a/src/slic3r/GUI/Widgets/AMSControl.cpp b/src/slic3r/GUI/Widgets/AMSControl.cpp index 5d46882ec..d0f8c080b 100644 --- a/src/slic3r/GUI/Widgets/AMSControl.cpp +++ b/src/slic3r/GUI/Widgets/AMSControl.cpp @@ -834,8 +834,8 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in auto mouse_pos = ClientToScreen(e.GetPosition()); auto rect = ClientToScreen(wxPoint(0, 0)); - if (mouse_pos.x > rect.x + GetSize().x - FromDIP(20) && - mouse_pos.y > rect.y + GetSize().y - FromDIP(40)) { + if (mouse_pos.x > rect.x + GetSize().x - FromDIP(25) && + mouse_pos.y > rect.y + GetSize().y - FromDIP(25)) { wxCommandEvent event(EVT_AMS_SHOW_HUMIDITY_TIPS); wxPostEvent(GetParent()->GetParent(), event); } @@ -1947,6 +1947,7 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons wxPoint popup_pos(img_pos.x, img_pos.y + GetRect().height); m_Humidity_tip_popup.Position(popup_pos, wxSize(0, 0)); m_Humidity_tip_popup.Popup(); + m_Humidity_tip_popup.GetParent()->SetFocus(); });