mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-20 07:11:12 -06:00 
			
		
		
		
	FIX:fixed speed control window will not dismiss
Change-Id: I7d053936fd13b08f624f7e1488fcc79d9a270f53
This commit is contained in:
		
							parent
							
								
									e2b8bff660
								
							
						
					
					
						commit
						eb86b00c82
					
				
					 3 changed files with 24 additions and 8 deletions
				
			
		|  | @ -3058,16 +3058,13 @@ void StatusPanel::on_switch_speed(wxCommandEvent &event) | |||
|     }); | ||||
|     popUp->Bind(wxEVT_SHOW, [this, popUp](auto &e) { | ||||
|         if (!e.IsShown()) { | ||||
|            /* 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) { | ||||
|     m_ams_control->Bind(EVT_CLEAR_SPEED_CONTROL, [this, popUp](auto& e) { | ||||
|         if (m_showing_speed_popup) { | ||||
|             if (popUp && popUp->IsShown()) { | ||||
|                 popUp->Show(false); | ||||
|  |  | |||
|  | @ -31,6 +31,7 @@ wxDEFINE_EVENT(EVT_AMS_GUIDE_WIKI, wxCommandEvent); | |||
| wxDEFINE_EVENT(EVT_AMS_RETRY, wxCommandEvent); | ||||
| wxDEFINE_EVENT(EVT_AMS_SHOW_HUMIDITY_TIPS, wxCommandEvent); | ||||
| wxDEFINE_EVENT(EVT_AMS_UNSELETED_VAMS, wxCommandEvent); | ||||
| wxDEFINE_EVENT(EVT_CLEAR_SPEED_CONTROL, wxCommandEvent); | ||||
| 
 | ||||
| bool AMSinfo::parse_ams_info(Ams *ams, bool remain_flag, bool humidity_flag) | ||||
| { | ||||
|  | @ -1030,8 +1031,15 @@ AMSRoad::AMSRoad(wxWindow *parent, wxWindowID id, Caninfo info, int canindex, in | |||
| 
 | ||||
|             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); | ||||
|                 wxCommandEvent show_event(EVT_AMS_SHOW_HUMIDITY_TIPS); | ||||
|                 wxPostEvent(GetParent()->GetParent(), show_event); | ||||
| 
 | ||||
| #ifdef __WXMSW__ | ||||
|                 wxCommandEvent close_event(EVT_CLEAR_SPEED_CONTROL); | ||||
|                 wxPostEvent(GetParent()->GetParent(), close_event); | ||||
| #endif // __WXMSW__
 | ||||
| 
 | ||||
|                 | ||||
|             } | ||||
|         } | ||||
|     }); | ||||
|  | @ -1803,6 +1811,11 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons | |||
|          m_ams_introduce_popup.set_mode(true); | ||||
|          m_ams_introduce_popup.Position(popup_pos, wxSize(0, 0)); | ||||
|          m_ams_introduce_popup.Popup(); | ||||
| 
 | ||||
| #ifdef __WXMSW__ | ||||
|          wxCommandEvent close_event(EVT_CLEAR_SPEED_CONTROL); | ||||
|          wxPostEvent(this, close_event); | ||||
| #endif // __WXMSW__
 | ||||
|     }); | ||||
|     img_amsmapping_tip->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) { | ||||
|          m_ams_introduce_popup.Dismiss(); | ||||
|  | @ -2028,6 +2041,11 @@ AMSControl::AMSControl(wxWindow *parent, wxWindowID id, const wxPoint &pos, cons | |||
|         m_ams_introduce_popup.set_mode(false); | ||||
|         m_ams_introduce_popup.Position(popup_pos, wxSize(0, 0)); | ||||
|         m_ams_introduce_popup.Popup(); | ||||
| 
 | ||||
| #ifdef __WXMSW__ | ||||
|         wxCommandEvent close_event(EVT_CLEAR_SPEED_CONTROL); | ||||
|         wxPostEvent(this, close_event); | ||||
| #endif // __WXMSW__
 | ||||
|     }); | ||||
| 
 | ||||
|     img_vams_tip->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& e) { | ||||
|  |  | |||
|  | @ -641,6 +641,7 @@ wxDECLARE_EVENT(EVT_AMS_GUIDE_WIKI, wxCommandEvent); | |||
| wxDECLARE_EVENT(EVT_AMS_RETRY, wxCommandEvent); | ||||
| wxDECLARE_EVENT(EVT_AMS_SHOW_HUMIDITY_TIPS, wxCommandEvent); | ||||
| wxDECLARE_EVENT(EVT_AMS_UNSELETED_VAMS, wxCommandEvent); | ||||
| wxDECLARE_EVENT(EVT_CLEAR_SPEED_CONTROL, wxCommandEvent); | ||||
| 
 | ||||
| }} // namespace Slic3r::GUI
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 tao wang
						tao wang