diff --git a/example/qml-Qt6/page/T_Settings.qml b/example/qml-Qt6/page/T_Settings.qml index 6ee2a234..76881c19 100644 --- a/example/qml-Qt6/page/T_Settings.qml +++ b/example/qml-Qt6/page/T_Settings.qml @@ -83,7 +83,6 @@ FluScrollablePage{ anchors.verticalCenter: parent.verticalCenter onClicked: { FluApp.useSystemAppBar = !FluApp.useSystemAppBar - dialog_restart.open() } } } diff --git a/example/qml/page/T_Settings.qml b/example/qml/page/T_Settings.qml index e06b5f43..27fea45d 100644 --- a/example/qml/page/T_Settings.qml +++ b/example/qml/page/T_Settings.qml @@ -86,7 +86,6 @@ FluScrollablePage{ anchors.verticalCenter: parent.verticalCenter onClicked: { FluApp.useSystemAppBar = !FluApp.useSystemAppBar - dialog_restart.open() } } } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 895dfe14..84a09862 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -124,7 +124,6 @@ endif() #去掉mingw生成的动态库libxxx前缀lib,不去掉前缀会导致 module "FluentUI" plugin "fluentuiplugin" not found if(MINGW) set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "") - set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX ".debug") endif() #MSVC Debug 添加后缀d,与Qt插件风格保持一致 diff --git a/src/FluFrameless.cpp b/src/FluFrameless.cpp index 51d942c5..dd3a7da2 100644 --- a/src/FluFrameless.cpp +++ b/src/FluFrameless.cpp @@ -15,39 +15,14 @@ #include #include #include - +#include static inline QByteArray qtNativeEventType() { static const auto result = "windows_generic_MSG"; return result; } - -int getSystemMetrics2(const WId windowId, const int index, const bool scaled){ - Q_ASSERT(windowId); - if (!windowId) { - return 0; - } - const UINT realDpi = GetDpiForWindow(reinterpret_cast(windowId)); - { - const UINT dpi = (scaled ? realDpi : USER_DEFAULT_SCREEN_DPI); - if (const int result = GetSystemMetricsForDpi(index, dpi); result > 0) { - return result; - } - } - const qreal dpr = (scaled ? qreal(1) : (qreal(realDpi) / qreal(USER_DEFAULT_SCREEN_DPI))); - return std::round(qreal(::GetSystemMetrics(index)) / dpr); -} - -quint32 getResizeBorderThickness(const WId windowId, const bool scaled){ - if (!windowId) { - return 0; - } - return getSystemMetrics2(windowId, SM_CXSIZEFRAME, scaled) + getSystemMetrics2(windowId, SM_CXPADDEDBORDER, scaled); -} - #endif - FramelessEventFilter::FramelessEventFilter(QQuickWindow* window){ _window = window; _current = window->winId(); @@ -73,7 +48,7 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void * return false; } const LPARAM lParam = msg->lParam; - const int borderPadding = getResizeBorderThickness(_window->winId(), true); + const int borderPadding = 8; if (uMsg == WM_NCCALCSIZE) { if (_window->visibility() == QWindow::FullScreen) { NCCALCSIZE_PARAMS* sz = reinterpret_cast(lParam); @@ -256,9 +231,9 @@ void FluFrameless::componentComplete(){ if(!_window.isNull()){ _nativeEvent =new FramelessEventFilter(_window); qApp->installNativeEventFilter(_nativeEvent); - MARGINS margins[2]{{0, 0, 0, 0}, {0, 0, 1, 0}}; - HWND hWnd = reinterpret_cast(_window->winId()); - DwmExtendFrameIntoClientArea(hWnd, &margins[false]); + // MARGINS margins[2]{{0, 0, 0, 0}, {0, 0, 1, 0}}; + // HWND hWnd = reinterpret_cast(_window->winId()); + // DwmExtendFrameIntoClientArea(hWnd, &margins[false]); refresLayout(); connect(_window,&QWindow::visibilityChanged,this,[=](QWindow::Visibility visibility){ refresLayout(); }); } diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml index 64a36262..ee98b329 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml @@ -36,7 +36,7 @@ Window { property bool showMinimize: true property bool showMaximize: true property bool showStayTop: true - flags: Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint + flags: Qt.Window | Qt.WindowTitleHint | Qt.WindowSystemMenuHint | Qt.WindowMinMaxButtonsHint | Qt.WindowCloseButtonHint property bool autoMaximize: false property var closeListener: function(event){ if(closeDestory){