mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-22 12:45:17 +00:00
fix: bambu slice hover popup disappears to fast macos
This commit is contained in:
@@ -338,7 +338,15 @@ void FilamentGroupPopup::OnRadioBtn(int idx)
|
||||
}
|
||||
}
|
||||
|
||||
void FilamentGroupPopup::OnTimer(wxTimerEvent &event) { Dismiss(); }
|
||||
void FilamentGroupPopup::OnTimer(wxTimerEvent&)
|
||||
{
|
||||
if (IsMouseInPopup()) {
|
||||
StartTimer();
|
||||
return;
|
||||
}
|
||||
|
||||
Dismiss();
|
||||
}
|
||||
|
||||
void FilamentGroupPopup::Dismiss() {
|
||||
m_active = false;
|
||||
@@ -348,19 +356,22 @@ void FilamentGroupPopup::Dismiss() {
|
||||
|
||||
void FilamentGroupPopup::OnLeaveWindow(wxMouseEvent &)
|
||||
{
|
||||
wxPoint pos = this->ScreenToClient(wxGetMousePosition());
|
||||
if (this->GetClientRect().Contains(pos)) return;
|
||||
if (this->GetScreenRect().Contains(wxGetMousePosition())) return;
|
||||
StartTimer();
|
||||
}
|
||||
|
||||
void FilamentGroupPopup::OnEnterWindow(wxMouseEvent &)
|
||||
{
|
||||
// Ignore spurious ENTER synthesized by PopupWindow::OnMouseEvent2 on macOS.
|
||||
wxPoint pos = this->ScreenToClient(wxGetMousePosition());
|
||||
if (!this->GetClientRect().Contains(pos)) return;
|
||||
if (!this->GetScreenRect().Contains(wxGetMousePosition())) return;
|
||||
ResetTimer();
|
||||
}
|
||||
|
||||
bool FilamentGroupPopup::IsMouseInPopup() const
|
||||
{
|
||||
return this->GetScreenRect().Contains(wxGetMousePosition());
|
||||
}
|
||||
|
||||
void FilamentGroupPopup::UpdateButtonStatus(int hover_idx)
|
||||
{
|
||||
for (int i = 0; i < ButtonType::btCount; ++i) {
|
||||
@@ -394,4 +405,4 @@ void FilamentGroupPopup::UpdateButtonStatus(int hover_idx)
|
||||
Fit();
|
||||
}
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
}} // namespace Slic3r::GUI
|
||||
|
||||
@@ -36,6 +36,7 @@ private:
|
||||
void OnEnterWindow(wxMouseEvent &);
|
||||
void OnTimer(wxTimerEvent &event);
|
||||
void Dismiss();
|
||||
bool IsMouseInPopup() const;
|
||||
|
||||
void CreateBmps();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user