This commit is contained in:
朱子楚\zhuzi 2023-12-28 20:47:36 +08:00
parent 46f7299362
commit 91a692484f
2 changed files with 4 additions and 2 deletions

View File

@ -65,7 +65,6 @@ if(QT_VERSION VERSION_GREATER_EQUAL "6.2")
endforeach()
endif()
#qml
if (FLUENTUI_BUILD_STATIC_LIB)
set(LIB_TYPE "STATIC")
else()

View File

@ -153,7 +153,7 @@ void FluFramelessHelper::_updateCursor(int edges){
}
bool FluFramelessHelper::eventFilter(QObject *obj, QEvent *ev){
if (!window.isNull() && window->flags() & Qt::FramelessWindowHint) {
if (!window.isNull() && window->flags()) {
static int edges = 0;
const int margin = 8;
@ -223,7 +223,9 @@ void FluFramelessHelper::componentComplete(){
}
if(!window.isNull()){
#ifdef Q_OS_WIN
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3))
window->setFlags(window->flags() | Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);
#endif
_nativeEvent =new FramelessEventFilter(this);
qApp->installNativeEventFilter(_nativeEvent);
HWND hwnd = reinterpret_cast<HWND>(window->winId());
@ -234,6 +236,7 @@ void FluFramelessHelper::componentComplete(){
SetWindowLongPtr(hwnd, GWL_STYLE, style | WS_THICKFRAME | WS_CAPTION);
}
showShadow(hwnd);
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
#else
window->setFlags((window->flags() & (~Qt::WindowMinMaxButtonsHint) & (~Qt::Dialog)) | Qt::FramelessWindowHint | Qt::Window);
#endif