diff --git a/example/.cmake/win_app.rc.in b/example/.cmake/win_app.rc.in index 781b323..e24945b 100644 --- a/example/.cmake/win_app.rc.in +++ b/example/.cmake/win_app.rc.in @@ -21,7 +21,7 @@ BEGIN BEGIN VALUE "Comments", "Made by Mentalflow." VALUE "CompanyName", "${PROJECT_COMPANY}" - VALUE "FileDescription", "${PROJECT_COPYRIGHT}" + VALUE "FileDescription", "${PROJECT_BUNDLE_NAME}" VALUE "FileVersion", "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" VALUE "InternalName", "${PROJECT_BUNDLE_NAME}.exe" VALUE "LegalCopyright", "${PROJECT_COPYRIGHT}" diff --git a/example/about.qml b/example/about.qml index 7fa4d3f..0b2a8f4 100644 --- a/example/about.qml +++ b/example/about.qml @@ -7,8 +7,7 @@ RibbonWindow { id: window width: Math.max(content.width, content.height + title_bar.height, title_bar.minimumWidth) + content.anchors.margins * 2 minimumWidth: title_bar.minimumWidth - minimumHeight: content.height + title_bar.height - height: width + minimumHeight: content.height + title_bar.height + content.anchors.margins * 2 title: qsTr("About") title_bar.show_darkmode_btn: false title_bar.show_style_switch: false diff --git a/lib_source/CMakeLists.txt b/lib_source/CMakeLists.txt index c873370..cbdc107 100644 --- a/lib_source/CMakeLists.txt +++ b/lib_source/CMakeLists.txt @@ -21,6 +21,9 @@ if(APPLE) endif() if (RIBBONUI_BUILD_QWINDOWKIT) + if(WIN32) + set(QWINDOWKIT_ENABLE_WINDOWS_SYSTEM_BORDERS OFF) + endif() set(QWINDOWKIT_BUILD_STATIC ON) set(QWINDOWKIT_BUILD_EXAMPLES OFF) set(QWINDOWKIT_BUILD_QUICK ON) diff --git a/lib_source/qml/RibbonWindow.qml b/lib_source/qml/RibbonWindow.qml index 1e2f578..cf05a4b 100644 --- a/lib_source/qml/RibbonWindow.qml +++ b/lib_source/qml/RibbonWindow.qml @@ -16,7 +16,7 @@ Window { property alias title_bar: titleBar property alias popup: pop property bool comfirmed_quit: false - property bool blurBehindWindow: false + property bool blurBehindWindow: true visible: false color: { if (blurBehindWindow) { @@ -29,7 +29,7 @@ Window { } onBlurBehindWindowChanged: { if (Qt.platform.os === 'windows') - windowAgent.setWindowAttribute("acrylic-material", blurBehindWindow) + windowAgent.setWindowAttribute("mica", blurBehindWindow) else if (Qt.platform.os === 'osx') windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.dark_mode ? "dark" : "light" : "none") } @@ -38,22 +38,23 @@ Window { windowAgent.setup(window) if (Qt.platform.os === 'windows') { - windowAgent.setWindowAttribute("acrylic-material", blurBehindWindow) + windowAgent.setWindowAttribute("mica", blurBehindWindow) windowAgent.setSystemButton(WindowAgent.Minimize, titleBar.minimizeBtn); windowAgent.setSystemButton(WindowAgent.Maximize, titleBar.maximizeBtn); windowAgent.setSystemButton(WindowAgent.Close, titleBar.closeBtn); } if(Qt.platform.os === "osx") { - blurBehindWindow = true windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.dark_mode ? "dark" : "light" : "none") PlatformSupport.showSystemTitleBtns(window, true) } windowAgent.setHitTestVisible(titleBar.left_container) windowAgent.setHitTestVisible(titleBar.right_container) - windowAgent.setTitleBar(titleBar); + windowAgent.setTitleBar(titleBar) windowAgent.centralize() - window.visible = true; + window.flags ^= Qt.WA_AlwaysShowToolTips // It's a trick for Windows + window.visible = true + window.flags ^= Qt.WA_AlwaysShowToolTips // It's a trick for Windows } Item{ id: window_items @@ -98,7 +99,7 @@ Window { color: 'transparent' border.color: RibbonTheme.dark_mode ? "#7A7A7A" : "#2C59B7" border.width: RibbonTheme.modern_style ? 1 : 0 - radius: Qt.platform.os === 'windows' ? 8 : 10 + radius: Qt.platform.os === 'windows' ? 7 : 10 visible: RibbonTheme.modern_style } RibbonPopup{ diff --git a/lib_source/ribbonui.cpp b/lib_source/ribbonui.cpp index c5c011d..c5d85a5 100644 --- a/lib_source/ribbonui.cpp +++ b/lib_source/ribbonui.cpp @@ -32,6 +32,9 @@ void RibbonUI::init() qputenv("QT_QUICK_CONTROLS_STYLE", "Basic"); #else qputenv("QT_QUICK_CONTROLS_STYLE", "Default"); +#endif +#ifdef Q_OS_WIN + qputenv("QSG_RHI_BACKEND", "opengl"); #endif QQuickWindow::setDefaultAlphaBuffer(true); }