mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-06 14:57:50 -07:00
Make top resizing grabber larger on Windows (#11023)
This commit is contained in:
parent
0493ed03a5
commit
e20113402c
3 changed files with 54 additions and 0 deletions
|
|
@ -739,6 +739,36 @@ WXLRESULT MainFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_NCHITTEST: {
|
||||
if (IsMaximized()) {
|
||||
// When maximized, no resize border
|
||||
return HTCAPTION;
|
||||
}
|
||||
|
||||
// Allow resizing from top of the title bar
|
||||
wxPoint mouse_pos = ::wxGetMousePosition();
|
||||
if (m_topbar->GetScreenRect().GetBottom() >= mouse_pos.y) {
|
||||
RECT borderThickness;
|
||||
SetRectEmpty(&borderThickness);
|
||||
AdjustWindowRectEx(&borderThickness, GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION, FALSE, NULL);
|
||||
borderThickness.left *= -1;
|
||||
borderThickness.top *= -1;
|
||||
wxPoint client_pos = this->ScreenToClient(mouse_pos);
|
||||
|
||||
bool on_top_border = client_pos.y <= borderThickness.top;
|
||||
|
||||
// And to allow diagonally resizing, we check if mouse is at window corner
|
||||
if (client_pos.x <= borderThickness.left) {
|
||||
return on_top_border ? HTTOPLEFT : HTLEFT;
|
||||
} else if (client_pos.x >= GetClientSize().x - borderThickness.right) {
|
||||
return on_top_border ? HTTOPRIGHT : HTRIGHT;
|
||||
}
|
||||
|
||||
return on_top_border ? HTTOP : HTCAPTION;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_GETMINMAXINFO: {
|
||||
auto mmi = (MINMAXINFO*) lParam;
|
||||
HandleGetMinMaxInfo(mmi);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue