mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-13 23:15:58 +08:00
Revert "Fix for #11988 : Drop down menus appear outside of PS and cannot be opened again"
This reverts commit 6ff8537ff4fbd14ca09934cdb2bb987131a7b559. There is a non-trivial conflict when merging to master, let's redo the commit after the merge so it is clear in history.
This commit is contained in:
parent
df14f7518d
commit
69e0bc3064
@ -753,38 +753,10 @@ static wxRichToolTipPopup* get_rtt_popup(wxButton* btn)
|
|||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Help function to find and check if some combobox is dropped down and then dismiss it
|
|
||||||
static bool found_and_dismiss_shown_dropdown(wxWindow* win)
|
|
||||||
{
|
|
||||||
auto children = win->GetChildren();
|
|
||||||
if (children.IsEmpty()) {
|
|
||||||
if (auto dd = dynamic_cast<DropDown*>(win); dd && dd->IsShown()) {
|
|
||||||
dd->CallDismissAndNotify();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (auto child : children) {
|
|
||||||
if (found_and_dismiss_shown_dropdown(child))
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sidebar::priv::show_rich_tip(const wxString& tooltip, wxButton* btn)
|
void Sidebar::priv::show_rich_tip(const wxString& tooltip, wxButton* btn)
|
||||||
{
|
{
|
||||||
if (tooltip.IsEmpty())
|
if (tooltip.IsEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Currently state (propably wxWidgets issue) :
|
|
||||||
// When second wxPopupTransientWindow is popped up, then first wxPopupTransientWindow doesn't receive EVT_DISMISS and stay on the top.
|
|
||||||
// New comboboxes use wxPopupTransientWindow as DropDown now
|
|
||||||
// That is why DropDown stay on top, when we show rich tooltip for btn.
|
|
||||||
// (see https://github.com/prusa3d/PrusaSlicer/issues/11988)
|
|
||||||
|
|
||||||
// So, check the combo boxes and close them if necessary before showing the rich tip.
|
|
||||||
found_and_dismiss_shown_dropdown(scrolled);
|
|
||||||
|
|
||||||
wxRichToolTip tip(tooltip, "");
|
wxRichToolTip tip(tooltip, "");
|
||||||
tip.SetIcon(wxICON_NONE);
|
tip.SetIcon(wxICON_NONE);
|
||||||
tip.SetTipKind(wxTipKind_BottomRight);
|
tip.SetTipKind(wxTipKind_BottomRight);
|
||||||
|
@ -86,8 +86,6 @@ public:
|
|||||||
bool HasDismissLongTime();
|
bool HasDismissLongTime();
|
||||||
|
|
||||||
static void SetTransparentBG(wxDC& dc, wxWindow* win);
|
static void SetTransparentBG(wxDC& dc, wxWindow* win);
|
||||||
|
|
||||||
void CallDismissAndNotify() { DismissAndNotify(); }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void OnDismiss() override;
|
void OnDismiss() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user