This commit is contained in:
zhuzichu 2024-01-05 18:18:08 +08:00
parent fde1b5ff3a
commit ae2d517ad0
2 changed files with 3 additions and 14 deletions

View File

@ -16,15 +16,6 @@ static inline QByteArray qtNativeEventType()
return result; return result;
} }
static inline bool isTaskbarAutoHide() {
APPBARDATA appBarData;
memset(&appBarData, 0, sizeof(appBarData));
appBarData.cbSize = sizeof(appBarData);
appBarData.hWnd = FindWindowW(L"Shell_TrayWnd", NULL);
LPARAM lParam = SHAppBarMessage(ABM_GETSTATE, &appBarData);
return lParam & ABS_AUTOHIDE;
}
static inline QColor getAccentColor(){ static inline QColor getAccentColor(){
typedef HRESULT (WINAPI* DwmGetColorizationColorPtr)(DWORD* pcrColorization,BOOL* pfOpaqueBlend); typedef HRESULT (WINAPI* DwmGetColorizationColorPtr)(DWORD* pcrColorization,BOOL* pfOpaqueBlend);
HMODULE module = LoadLibraryW(L"dwmapi.dll"); HMODULE module = LoadLibraryW(L"dwmapi.dll");
@ -126,9 +117,6 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
bool isMax = IsZoomed(hwnd); bool isMax = IsZoomed(hwnd);
if(isMax){ if(isMax){
_helper->setOriginalPos(QPoint(originalLeft,originalTop)); _helper->setOriginalPos(QPoint(originalLeft,originalTop));
if(isTaskbarAutoHide()){
clientRect->bottom -= 1;
}
offsetTop = 0; offsetTop = 0;
}else{ }else{
_helper->setOriginalPos({}); _helper->setOriginalPos({});
@ -148,7 +136,8 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
} }
return true; return true;
} }
return false; *result = HTCLIENT;
return true;
}else if(uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN){ }else if(uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN){
if(FluTools::getInstance()->isWindows11OrGreater() && _helper->hoverMaxBtn() && _helper->resizeable()){ if(FluTools::getInstance()->isWindows11OrGreater() && _helper->hoverMaxBtn() && _helper->resizeable()){
QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier); QMouseEvent event = QMouseEvent(QEvent::MouseButtonPress, QPoint(), QPoint(), Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);

View File

@ -162,7 +162,7 @@ QString NetworkParams::buildCacheKey(){
void NetworkParams::go(NetworkCallable* callable){ void NetworkParams::go(NetworkCallable* callable){
QJSValueList data; QJSValueList data;
data<<qjsEngine(FluNetwork::getInstance())->newQObject(this); data<<qjsEngine(callable)->newQObject(this);
FluNetwork::getInstance()->_interceptor.call(data); FluNetwork::getInstance()->_interceptor.call(data);
if(_downloadParam){ if(_downloadParam){
FluNetwork::getInstance()->handleDownload(this,callable); FluNetwork::getInstance()->handleDownload(this,callable);