mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 23:17:35 -06:00
Do not limit the max window size (#3149)
Do not limit the max window size (#2889) Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
parent
eeef52bf5d
commit
6bb0d5ec30
2 changed files with 8 additions and 26 deletions
|
@ -531,15 +531,6 @@ void BBLTopbar::OnFullScreen(wxAuiToolBarEvent& event)
|
||||||
m_frame->Restore();
|
m_frame->Restore();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
wxDisplay display(this);
|
|
||||||
auto size = display.GetClientArea().GetSize();
|
|
||||||
#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_normalRect = m_frame->GetRect();
|
||||||
m_frame->Maximize();
|
m_frame->Maximize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -396,29 +396,20 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
||||||
sizer->SetSizeHints(this);
|
sizer->SetSizeHints(this);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
auto setMaxSize = [this]() {
|
// SetMaximize causes the window to overlap the taskbar, due to the fact this window has wxMAXIMIZE_BOX off
|
||||||
wxDisplay display(this);
|
// https://forums.wxwidgets.org/viewtopic.php?t=50634
|
||||||
auto size = display.GetClientArea().GetSize();
|
// Fix it here
|
||||||
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) {
|
this->Bind(wxEVT_MAXIMIZE, [this](auto &e) {
|
||||||
wxDisplay display(this);
|
wxDisplay display(this);
|
||||||
auto pos = display.GetClientArea().GetPosition();
|
auto size = display.GetClientArea().GetSize();
|
||||||
|
auto pos = display.GetClientArea().GetPosition();
|
||||||
HWND hWnd = GetHandle();
|
HWND hWnd = GetHandle();
|
||||||
RECT borderThickness;
|
RECT borderThickness;
|
||||||
SetRectEmpty(&borderThickness);
|
SetRectEmpty(&borderThickness);
|
||||||
AdjustWindowRectEx(&borderThickness, GetWindowLongPtr(hWnd, GWL_STYLE), FALSE, 0);
|
AdjustWindowRectEx(&borderThickness, GetWindowLongPtr(hWnd, GWL_STYLE), FALSE, 0);
|
||||||
|
const auto max_size = size + wxSize{-borderThickness.left + borderThickness.right, -borderThickness.top + borderThickness.bottom};
|
||||||
|
const auto current_size = GetSize();
|
||||||
|
SetSize({std::min(max_size.x, current_size.x), std::min(max_size.y, current_size.y)});
|
||||||
Move(pos + wxPoint{borderThickness.left, borderThickness.top});
|
Move(pos + wxPoint{borderThickness.left, borderThickness.top});
|
||||||
e.Skip();
|
e.Skip();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue