From 2d2e7d627b6dc9b584e574d64aa3fd019e89c3c3 Mon Sep 17 00:00:00 2001 From: Mentalflow <312902918@qq.com> Date: Mon, 22 Apr 2024 00:45:13 +0800 Subject: [PATCH] RibbonWindow: Fix blur behind window color in macOS. --- lib_source/qml/RibbonWindow.qml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib_source/qml/RibbonWindow.qml b/lib_source/qml/RibbonWindow.qml index 04f5c2d..251bf8c 100644 --- a/lib_source/qml/RibbonWindow.qml +++ b/lib_source/qml/RibbonWindow.qml @@ -39,22 +39,25 @@ Window { windowAgent.setup(window) if (Qt.platform.os === 'windows') { - windowAgent.setWindowAttribute("dwm-blur", blurBehindWindow) windowAgent.setSystemButton(WindowAgent.Minimize, titleBar.minimizeBtn); windowAgent.setSystemButton(WindowAgent.Maximize, titleBar.maximizeBtn); windowAgent.setSystemButton(WindowAgent.Close, titleBar.closeBtn); } - if(Qt.platform.os === "osx") - { - windowAgent.setWindowAttribute("dark-mode", RibbonTheme.dark_mode) - 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.centralize() window.visible = true + windowAgent.setWindowAttribute("dark-mode", RibbonTheme.dark_mode) + if (Qt.platform.os === 'windows') + { + windowAgent.setWindowAttribute("dwm-blur", blurBehindWindow) + } + if(Qt.platform.os === "osx") + { + windowAgent.setWindowAttribute("blur-effect", blurBehindWindow ? RibbonTheme.dark_mode ? "dark" : "light" : "none") + PlatformSupport.showSystemTitleBtns(window, true) + } } Item{ id: window_items