mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-14 06:35:57 +08:00
Merge some BS1.7 changes:
fix full screen issue on Windows
This commit is contained in:
parent
da05ae02da
commit
f8c9c6bfc4
@ -528,7 +528,13 @@ void BBLTopbar::OnFullScreen(wxAuiToolBarEvent& event)
|
||||
else {
|
||||
wxDisplay display(this);
|
||||
auto size = display.GetClientArea().GetSize();
|
||||
m_frame->SetMaxSize(size + wxSize{16, 16});
|
||||
#ifdef __WXMSW__
|
||||
HWND hWnd = m_frame->GetHandle();
|
||||
RECT borderThickness;
|
||||
SetRectEmpty(&borderThickness);
|
||||
AdjustWindowRectEx(&borderThickness, GetWindowLongPtr(hWnd, GWL_STYLE), FALSE, 0);
|
||||
m_frame->SetMaxSize(size + wxSize{-borderThickness.left + borderThickness.right, -borderThickness.top + borderThickness.bottom});
|
||||
#endif // __WXMSW__
|
||||
m_normalRect = m_frame->GetRect();
|
||||
m_frame->Maximize();
|
||||
}
|
||||
@ -553,16 +559,8 @@ void BBLTopbar::OnMouseLeftDClock(wxMouseEvent& mouse)
|
||||
return;
|
||||
#endif // __WXMSW__
|
||||
|
||||
if (m_frame->IsMaximized()) {
|
||||
m_frame->Restore();
|
||||
}
|
||||
else {
|
||||
wxDisplay display(this);
|
||||
auto size = display.GetClientArea().GetSize();
|
||||
m_frame->SetMaxSize(size + wxSize{16, 16});
|
||||
m_normalRect = m_frame->GetRect();
|
||||
m_frame->Maximize();
|
||||
}
|
||||
wxAuiToolBarEvent evt;
|
||||
OnFullScreen(evt);
|
||||
}
|
||||
|
||||
void BBLTopbar::OnFileToolItem(wxAuiToolBarEvent& evt)
|
||||
|
@ -381,23 +381,31 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
||||
update_layout();
|
||||
sizer->SetSizeHints(this);
|
||||
|
||||
// BBS: fix taskbar overlay on windows
|
||||
#ifdef WIN32
|
||||
auto setMaxSize = [this]() {
|
||||
wxDisplay display(this);
|
||||
auto size = display.GetClientArea().GetSize();
|
||||
// 8 pixels shadow
|
||||
SetMaxSize(size + wxSize{16, 16});
|
||||
HWND hWnd = GetHandle();
|
||||
RECT borderThickness;
|
||||
SetRectEmpty(&borderThickness);
|
||||
AdjustWindowRectEx(&borderThickness, GetWindowLongPtr(hWnd, GWL_STYLE), FALSE, 0);
|
||||
SetMaxSize(size + wxSize{-borderThickness.left + borderThickness.right, -borderThickness.top + borderThickness.bottom});
|
||||
};
|
||||
this->Bind(wxEVT_DPI_CHANGED, [setMaxSize](auto & e) {
|
||||
setMaxSize();
|
||||
e.Skip();
|
||||
});
|
||||
setMaxSize();
|
||||
// SetMaximize already position window at left/top corner, even if Windows Task Bar is at left side.
|
||||
// Not known why, but fix it here
|
||||
this->Bind(wxEVT_MAXIMIZE, [this](auto &e) {
|
||||
wxDisplay display(this);
|
||||
auto pos = display.GetClientArea().GetPosition();
|
||||
Move(pos - wxPoint{8, 8});
|
||||
HWND hWnd = GetHandle();
|
||||
RECT borderThickness;
|
||||
SetRectEmpty(&borderThickness);
|
||||
AdjustWindowRectEx(&borderThickness, GetWindowLongPtr(hWnd, GWL_STYLE), FALSE, 0);
|
||||
Move(pos + wxPoint{borderThickness.left, borderThickness.top});
|
||||
e.Skip();
|
||||
});
|
||||
#endif // WIN32
|
||||
|
Loading…
x
Reference in New Issue
Block a user