This commit is contained in:
朱子楚\zhuzi 2024-01-03 21:21:33 +08:00
parent e0c28e2693
commit bb19554215
3 changed files with 2 additions and 7 deletions

View File

@ -116,9 +116,7 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
}else if(uMsg == WM_NCCALCSIZE){ }else if(uMsg == WM_NCCALCSIZE){
const auto clientRect = ((wParam == FALSE) ? reinterpret_cast<LPRECT>(lParam) : &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]); const auto clientRect = ((wParam == FALSE) ? reinterpret_cast<LPRECT>(lParam) : &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(lParam))->rgrc[0]);
const LONG originalTop = clientRect->top; const LONG originalTop = clientRect->top;
const LONG originalBottom = clientRect->bottom;
const LONG originalLeft = clientRect->left; const LONG originalLeft = clientRect->left;
const LONG originalRight = clientRect->right;
const LRESULT hitTestResult = ::DefWindowProcW(hwnd, WM_NCCALCSIZE, wParam, lParam); const LRESULT hitTestResult = ::DefWindowProcW(hwnd, WM_NCCALCSIZE, wParam, lParam);
if ((hitTestResult != HTERROR) && (hitTestResult != HTNOWHERE)) { if ((hitTestResult != HTERROR) && (hitTestResult != HTNOWHERE)) {
*result = hitTestResult; *result = hitTestResult;
@ -141,7 +139,6 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
} }
} }
clientRect->top = originalTop+offsetTop; clientRect->top = originalTop+offsetTop;
clientRect->bottom = originalBottom-offsetTop;
*result = WVR_REDRAW; *result = WVR_REDRAW;
return true; return true;
}if(uMsg == WM_NCHITTEST){ }if(uMsg == WM_NCHITTEST){
@ -300,9 +297,9 @@ void FluFramelessHelper::componentComplete(){
HWND hwnd = reinterpret_cast<HWND>(window->winId()); HWND hwnd = reinterpret_cast<HWND>(window->winId());
DWORD style = ::GetWindowLong(hwnd, GWL_STYLE); DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
if(resizeable()){ if(resizeable()){
SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME | WS_BORDER); SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_MAXIMIZEBOX | WS_THICKFRAME);
}else{ }else{
SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME | WS_BORDER); SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME);
} }
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
showShadow(hwnd); showShadow(hwnd);

View File

@ -209,7 +209,6 @@ Window {
anchors{ anchors{
fill:parent fill:parent
topMargin: _offsetXY.y topMargin: _offsetXY.y
bottomMargin: _offsetXY.y
} }
onWidthChanged: { onWidthChanged: {
window.appBar.width = width window.appBar.width = width

View File

@ -208,7 +208,6 @@ Window {
anchors{ anchors{
fill:parent fill:parent
topMargin: _offsetXY.y topMargin: _offsetXY.y
bottomMargin: _offsetXY.y
} }
onWidthChanged: { onWidthChanged: {
window.appBar.width = width window.appBar.width = width