mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 23:01:22 -06:00
FIX: Revert "[STUDIO-2186] hide PopupWindow on alt-tab"
This reverts commit 3b8c11659a6cf3062ad27772348b84be5001a4f6. Reason for revert: update pick Change-Id: Id991af5b4a5950ee76ecf59176eabc72c885db88
This commit is contained in:
parent
5c61c834b0
commit
5f69f4c016
23 changed files with 70 additions and 139 deletions
|
@ -5,7 +5,7 @@
|
|||
|
||||
wxDEFINE_EVENT(EVT_DISMISS, wxCommandEvent);
|
||||
|
||||
BEGIN_EVENT_TABLE(DropDown, PopupWindow)
|
||||
BEGIN_EVENT_TABLE(DropDown, wxPopupTransientWindow)
|
||||
|
||||
EVT_LEFT_DOWN(DropDown::mouseDown)
|
||||
EVT_LEFT_UP(DropDown::mouseReleased)
|
||||
|
@ -50,7 +50,7 @@ DropDown::DropDown(wxWindow * parent,
|
|||
void DropDown::Create(wxWindow * parent,
|
||||
long style)
|
||||
{
|
||||
PopupWindow::Create(parent, wxPU_CONTAINS_CONTROLS);
|
||||
wxPopupTransientWindow::Create(parent, wxPU_CONTAINS_CONTROLS);
|
||||
SetBackgroundStyle(wxBG_STYLE_PAINT);
|
||||
SetBackgroundColour(*wxWHITE);
|
||||
state_handler.attach({&border_color, &text_color, &selector_border_color, &selector_background_color});
|
||||
|
@ -62,7 +62,7 @@ void DropDown::Create(wxWindow * parent,
|
|||
// BBS set default font
|
||||
SetFont(Label::Body_14);
|
||||
#ifdef __WXOSX__
|
||||
// PopupWindow releases mouse on idle, which may cause various problems,
|
||||
// wxPopupTransientWindow releases mouse on idle, which may cause various problems,
|
||||
// such as losting mouse move, and dismissing soon on first LEFT_DOWN event.
|
||||
Bind(wxEVT_IDLE, [] (wxIdleEvent & evt) {});
|
||||
#endif
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
#include <wx/stattext.h>
|
||||
#include "../wxExtensions.hpp"
|
||||
#include "StateHandler.hpp"
|
||||
#include "PopupWindow.hpp"
|
||||
|
||||
#define DD_NO_CHECK_ICON 0x0001
|
||||
#define DD_NO_TEXT 0x0002
|
||||
|
@ -12,7 +11,7 @@
|
|||
|
||||
wxDECLARE_EVENT(EVT_DISMISS, wxCommandEvent);
|
||||
|
||||
class DropDown : public PopupWindow
|
||||
class DropDown : public wxPopupTransientWindow
|
||||
{
|
||||
std::vector<wxString> & texts;
|
||||
std::vector<wxBitmap> & icons;
|
||||
|
|
|
@ -499,7 +499,7 @@ void FanControl::post_event(wxCommandEvent&& event)
|
|||
Description:FanControlPopup
|
||||
**************************************************/
|
||||
FanControlPopup::FanControlPopup(wxWindow* parent)
|
||||
:PopupWindow(parent, wxBORDER_NONE)
|
||||
:wxPopupTransientWindow(parent, wxBORDER_NONE)
|
||||
{
|
||||
this->SetSizeHints(wxDefaultSize, wxDefaultSize);
|
||||
|
||||
|
@ -628,7 +628,7 @@ void FanControlPopup::post_event(int fan_type, wxString speed)
|
|||
|
||||
bool FanControlPopup::ProcessLeftDown(wxMouseEvent& event)
|
||||
{
|
||||
return PopupWindow::ProcessLeftDown(event);
|
||||
return wxPopupTransientWindow::ProcessLeftDown(event);
|
||||
}
|
||||
|
||||
void FanControlPopup::on_show(wxShowEvent& evt)
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
#include "StaticBox.hpp"
|
||||
#include "StepCtrl.hpp"
|
||||
#include "Button.hpp"
|
||||
#include "PopupWindow.hpp"
|
||||
#include "../DeviceManager.hpp"
|
||||
#include "slic3r/GUI/Event.hpp"
|
||||
#include <wx/simplebook.h>
|
||||
|
@ -138,7 +137,7 @@ public:
|
|||
/*************************************************
|
||||
Description:FanControlPopup
|
||||
**************************************************/
|
||||
class FanControlPopup : public PopupWindow
|
||||
class FanControlPopup : public wxPopupTransientWindow
|
||||
{
|
||||
public:
|
||||
FanControlPopup(wxWindow* parent);
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
#include "PopupWindow.hpp"
|
||||
|
||||
static wxWindow *GetTopParent(wxWindow *pWindow)
|
||||
{
|
||||
wxWindow *pWin = pWindow;
|
||||
while (pWin->GetParent()) pWin = pWin->GetParent();
|
||||
return pWin;
|
||||
}
|
||||
|
||||
bool PopupWindow::Create(wxWindow *parent, int style)
|
||||
{
|
||||
if (!wxPopupTransientWindow::Create(parent, style))
|
||||
return false;
|
||||
#ifdef __WXGTK__
|
||||
GetTopParent(parent)->Bind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
PopupWindow::~PopupWindow()
|
||||
{
|
||||
#ifdef __WXGTK__
|
||||
GetTopParent(this)->Unbind(wxEVT_ACTIVATE, &PopupWindow::topWindowActiavate, this);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __WXGTK__
|
||||
void PopupWindow::topWindowActiavate(wxActivateEvent &event)
|
||||
{
|
||||
event.Skip();
|
||||
if (!event.GetActive() && IsShown()) DismissAndNotify();
|
||||
}
|
||||
#endif
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef slic3r_GUI_PopupWindow_hpp_
|
||||
#define slic3r_GUI_PopupWindow_hpp_
|
||||
|
||||
#include <wx/popupwin.h>
|
||||
|
||||
class PopupWindow : public wxPopupTransientWindow
|
||||
{
|
||||
public:
|
||||
PopupWindow() {}
|
||||
|
||||
~PopupWindow();
|
||||
|
||||
PopupWindow(wxWindow *parent, int style = wxBORDER_NONE)
|
||||
{ Create(parent, style); }
|
||||
|
||||
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
|
||||
|
||||
private:
|
||||
#ifdef __WXGTK__
|
||||
void topWindowActiavate(wxActivateEvent &event);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif // !slic3r_GUI_PopupWindow_hpp_
|
|
@ -6,12 +6,12 @@
|
|||
|
||||
|
||||
|
||||
wxBEGIN_EVENT_TABLE(SidePopup,PopupWindow)
|
||||
wxBEGIN_EVENT_TABLE(SidePopup,wxPopupTransientWindow)
|
||||
EVT_PAINT(SidePopup::paintEvent)
|
||||
wxEND_EVENT_TABLE()
|
||||
|
||||
SidePopup::SidePopup(wxWindow* parent)
|
||||
:PopupWindow(parent,
|
||||
:wxPopupTransientWindow(parent,
|
||||
wxBORDER_NONE |
|
||||
wxPU_CONTAINS_CONTROLS)
|
||||
{
|
||||
|
@ -28,16 +28,16 @@ SidePopup::~SidePopup()
|
|||
void SidePopup::OnDismiss()
|
||||
{
|
||||
Slic3r::GUI::wxGetApp().set_side_menu_popup_status(false);
|
||||
PopupWindow::OnDismiss();
|
||||
wxPopupTransientWindow::OnDismiss();
|
||||
}
|
||||
|
||||
bool SidePopup::ProcessLeftDown(wxMouseEvent& event)
|
||||
{
|
||||
return PopupWindow::ProcessLeftDown(event);
|
||||
return wxPopupTransientWindow::ProcessLeftDown(event);
|
||||
}
|
||||
bool SidePopup::Show( bool show )
|
||||
{
|
||||
return PopupWindow::Show(show);
|
||||
return wxPopupTransientWindow::Show(show);
|
||||
}
|
||||
|
||||
void SidePopup::Popup(wxWindow* focus)
|
||||
|
@ -66,7 +66,7 @@ void SidePopup::Popup(wxWindow* focus)
|
|||
Position(pos, {0, focus->GetSize().y + 12});
|
||||
}
|
||||
Slic3r::GUI::wxGetApp().set_side_menu_popup_status(true);
|
||||
PopupWindow::Popup();
|
||||
wxPopupTransientWindow::Popup();
|
||||
}
|
||||
|
||||
void SidePopup::Create()
|
||||
|
|
|
@ -9,9 +9,8 @@
|
|||
#include "../wxExtensions.hpp"
|
||||
#include "StateHandler.hpp"
|
||||
#include "SideButton.hpp"
|
||||
#include "PopupWindow.hpp"
|
||||
|
||||
class SidePopup : public PopupWindow
|
||||
class SidePopup : public wxPopupTransientWindow
|
||||
{
|
||||
private:
|
||||
std::vector<SideButton*> btn_list;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include "TempInput.hpp"
|
||||
#include "Label.hpp"
|
||||
#include "PopupWindow.hpp"
|
||||
#include "../I18N.hpp"
|
||||
#include <wx/dcgraph.h>
|
||||
#include "../GUI.hpp"
|
||||
|
@ -191,7 +190,7 @@ void TempInput::Warning(bool warn, WarningType type)
|
|||
|
||||
if (warning_mode) {
|
||||
if (wdialog == nullptr) {
|
||||
wdialog = new PopupWindow(this);
|
||||
wdialog = new wxPopupTransientWindow(this);
|
||||
wdialog->SetBackgroundColour(wxColour(0xFFFFFF));
|
||||
|
||||
wdialog->SetSizeHints(wxDefaultSize, wxDefaultSize);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue