mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 18:42:24 +00:00
FIX: speed switch popup window display bug
Jira: [STUDIO-14642] Change-Id: If95ca1b448b2d3a03c2f6d6c0b5faad4a3c04e8c (cherry picked from commit 08943207564c0256d5a5efea9440e55efb7ccea0)
This commit is contained in:
@@ -4662,6 +4662,9 @@ void StatusPanel::on_switch_speed(wxCommandEvent &event)
|
|||||||
PopupWindow *popUp = new PopupWindow(nullptr);
|
PopupWindow *popUp = new PopupWindow(nullptr);
|
||||||
#else
|
#else
|
||||||
PopupWindow *popUp = new PopupWindow(m_switch_speed);
|
PopupWindow *popUp = new PopupWindow(m_switch_speed);
|
||||||
|
#endif
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
popUp->BindUnfocusEvent();
|
||||||
#endif
|
#endif
|
||||||
popUp->SetBackgroundColour(StateColor::darkModeColorFor(0xeeeeee));
|
popUp->SetBackgroundColour(StateColor::darkModeColorFor(0xeeeeee));
|
||||||
StepCtrl *step = new StepCtrl(popUp, wxID_ANY);
|
StepCtrl *step = new StepCtrl(popUp, wxID_ANY);
|
||||||
|
|||||||
@@ -31,6 +31,11 @@ PopupWindow::~PopupWindow()
|
|||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
GetTopParent(this)->Unbind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
|
GetTopParent(this)->Unbind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
GetTopParent(this)->Unbind(wxEVT_ACTIVATE, &PopupWindow::topWindowActivate, this);
|
||||||
|
GetTopParent(this)->Unbind(wxEVT_ICONIZE, &PopupWindow::topWindowIconize, this);
|
||||||
|
GetTopParent(this)->Unbind(wxEVT_SHOW, &PopupWindow::topWindowShow, this);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
@@ -84,3 +89,32 @@ void PopupWindow::topWindowActiavate(wxActivateEvent &event)
|
|||||||
if (!event.GetActive() && IsShown()) DismissAndNotify();
|
if (!event.GetActive() && IsShown()) DismissAndNotify();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
void PopupWindow::BindUnfocusEvent()
|
||||||
|
{
|
||||||
|
GetTopParent(this)->Bind(wxEVT_ACTIVATE, &PopupWindow::topWindowActivate, this);
|
||||||
|
GetTopParent(this)->Bind(wxEVT_ICONIZE, &PopupWindow::topWindowIconize, this);
|
||||||
|
GetTopParent(this)->Bind(wxEVT_SHOW, &PopupWindow::topWindowShow, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void PopupWindow::topWindowActivate(wxActivateEvent &event)
|
||||||
|
{
|
||||||
|
if (!event.GetActive())
|
||||||
|
Dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PopupWindow::topWindowIconize(wxIconizeEvent &event)
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
if (event.IsIconized())
|
||||||
|
Dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PopupWindow::topWindowShow(wxShowEvent &event)
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
if (!event.IsShown())
|
||||||
|
Dismiss();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define slic3r_GUI_PopupWindow_hpp_
|
#define slic3r_GUI_PopupWindow_hpp_
|
||||||
|
|
||||||
#include <wx/popupwin.h>
|
#include <wx/popupwin.h>
|
||||||
|
#include <wx/event.h>
|
||||||
|
|
||||||
class PopupWindow : public wxPopupTransientWindow
|
class PopupWindow : public wxPopupTransientWindow
|
||||||
{
|
{
|
||||||
@@ -10,11 +11,12 @@ public:
|
|||||||
|
|
||||||
~PopupWindow();
|
~PopupWindow();
|
||||||
|
|
||||||
PopupWindow(wxWindow *parent, int style = wxBORDER_NONE)
|
PopupWindow(wxWindow *parent, int style = wxBORDER_NONE) { Create(parent, style); }
|
||||||
{ Create(parent, style); }
|
|
||||||
|
|
||||||
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
|
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
void BindUnfocusEvent();
|
||||||
|
#endif
|
||||||
private:
|
private:
|
||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
void OnMouseEvent2(wxMouseEvent &evt);
|
void OnMouseEvent2(wxMouseEvent &evt);
|
||||||
@@ -24,6 +26,12 @@ private:
|
|||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
void topWindowActiavate(wxActivateEvent &event);
|
void topWindowActiavate(wxActivateEvent &event);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
void topWindowActivate(wxActivateEvent &event);
|
||||||
|
void topWindowIconize(wxIconizeEvent &event);
|
||||||
|
void topWindowShow(wxShowEvent &event);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // !slic3r_GUI_PopupWindow_hpp_
|
#endif // !slic3r_GUI_PopupWindow_hpp_
|
||||||
|
|||||||
Reference in New Issue
Block a user