mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-23 21:25:13 +00:00
fix: bambu slice hover popup disappears too fast macos
This commit is contained in:
@@ -166,11 +166,11 @@ FilamentGroupPopup::FilamentGroupPopup(wxWindow *parent) : PopupWindow(parent, w
|
|||||||
|
|
||||||
radio_btns[idx]->Bind(wxEVT_LEFT_DOWN, [this, idx](auto &) { OnRadioBtn(idx);});
|
radio_btns[idx]->Bind(wxEVT_LEFT_DOWN, [this, idx](auto &) { OnRadioBtn(idx);});
|
||||||
|
|
||||||
radio_btns[idx]->Bind(wxEVT_ENTER_WINDOW, [this, idx](auto &) { UpdateButtonStatus(idx); });
|
radio_btns[idx]->Bind(wxEVT_ENTER_WINDOW, [this, idx](auto &) { ResetTimer(); UpdateButtonStatus(idx); });
|
||||||
radio_btns[idx]->Bind(wxEVT_LEAVE_WINDOW, [this](auto &) { UpdateButtonStatus(); });
|
radio_btns[idx]->Bind(wxEVT_LEAVE_WINDOW, [this](auto &) { UpdateButtonStatus(); });
|
||||||
|
|
||||||
button_labels[idx]->Bind(wxEVT_LEFT_DOWN, [this, idx](auto &) { OnRadioBtn(idx);});
|
button_labels[idx]->Bind(wxEVT_LEFT_DOWN, [this, idx](auto &) { OnRadioBtn(idx);});
|
||||||
button_labels[idx]->Bind(wxEVT_ENTER_WINDOW, [this, idx](auto &) { UpdateButtonStatus(idx); });
|
button_labels[idx]->Bind(wxEVT_ENTER_WINDOW, [this, idx](auto &) { ResetTimer(); UpdateButtonStatus(idx); });
|
||||||
button_labels[idx]->Bind(wxEVT_LEAVE_WINDOW, [this](auto &) { UpdateButtonStatus(); });
|
button_labels[idx]->Bind(wxEVT_LEAVE_WINDOW, [this](auto &) { UpdateButtonStatus(); });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,7 +338,13 @@ void FilamentGroupPopup::OnRadioBtn(int idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilamentGroupPopup::OnTimer(wxTimerEvent &event) { Dismiss(); }
|
void FilamentGroupPopup::OnTimer(wxTimerEvent&)
|
||||||
|
{
|
||||||
|
if (IsMouseInPopup())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
void FilamentGroupPopup::Dismiss() {
|
void FilamentGroupPopup::Dismiss() {
|
||||||
m_active = false;
|
m_active = false;
|
||||||
@@ -361,6 +367,12 @@ void FilamentGroupPopup::OnEnterWindow(wxMouseEvent &)
|
|||||||
ResetTimer();
|
ResetTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FilamentGroupPopup::IsMouseInPopup() const
|
||||||
|
{
|
||||||
|
wxPoint pos = this->ScreenToClient(wxGetMousePosition());
|
||||||
|
return this->GetClientRect().Contains(pos);
|
||||||
|
}
|
||||||
|
|
||||||
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 +406,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