mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-23 21:25:13 +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() {
|
void FilamentGroupPopup::Dismiss() {
|
||||||
m_active = false;
|
m_active = false;
|
||||||
@@ -348,19 +356,22 @@ void FilamentGroupPopup::Dismiss() {
|
|||||||
|
|
||||||
void FilamentGroupPopup::OnLeaveWindow(wxMouseEvent &)
|
void FilamentGroupPopup::OnLeaveWindow(wxMouseEvent &)
|
||||||
{
|
{
|
||||||
wxPoint pos = this->ScreenToClient(wxGetMousePosition());
|
if (this->GetScreenRect().Contains(wxGetMousePosition())) return;
|
||||||
if (this->GetClientRect().Contains(pos)) return;
|
|
||||||
StartTimer();
|
StartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilamentGroupPopup::OnEnterWindow(wxMouseEvent &)
|
void FilamentGroupPopup::OnEnterWindow(wxMouseEvent &)
|
||||||
{
|
{
|
||||||
// Ignore spurious ENTER synthesized by PopupWindow::OnMouseEvent2 on macOS.
|
// Ignore spurious ENTER synthesized by PopupWindow::OnMouseEvent2 on macOS.
|
||||||
wxPoint pos = this->ScreenToClient(wxGetMousePosition());
|
if (!this->GetScreenRect().Contains(wxGetMousePosition())) return;
|
||||||
if (!this->GetClientRect().Contains(pos)) return;
|
|
||||||
ResetTimer();
|
ResetTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FilamentGroupPopup::IsMouseInPopup() const
|
||||||
|
{
|
||||||
|
return this->GetScreenRect().Contains(wxGetMousePosition());
|
||||||
|
}
|
||||||
|
|
||||||
void FilamentGroupPopup::UpdateButtonStatus(int hover_idx)
|
void FilamentGroupPopup::UpdateButtonStatus(int hover_idx)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < ButtonType::btCount; ++i) {
|
for (int i = 0; i < ButtonType::btCount; ++i) {
|
||||||
@@ -394,4 +405,4 @@ void FilamentGroupPopup::UpdateButtonStatus(int hover_idx)
|
|||||||
Fit();
|
Fit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // namespace Slic3r::GUI
|
}} // namespace Slic3r::GUI
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ private:
|
|||||||
void OnEnterWindow(wxMouseEvent &);
|
void OnEnterWindow(wxMouseEvent &);
|
||||||
void OnTimer(wxTimerEvent &event);
|
void OnTimer(wxTimerEvent &event);
|
||||||
void Dismiss();
|
void Dismiss();
|
||||||
|
bool IsMouseInPopup() const;
|
||||||
|
|
||||||
void CreateBmps();
|
void CreateBmps();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user