From 8fa2a5bcac322acf1029080e407394d153612f7e Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Tue, 26 May 2026 13:54:10 +0800 Subject: [PATCH] feat: add hasInWindowBlur QML property and version dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Added new `hasInWindowBlur` property to `DQMLGlobalObject` for QML access 2. Updated InWindowBlur component to use `hasInWindowBlur` for blur disabling 3. Updated debian/control with minimum version requirements for dtk dependencies 4. Changed copyright year to 2023-2026 Log: Added hasInWindowBlur QML property for blur availability check Influence: 1. Test hasInWindowBlur property returns correct boolean on various platforms 2. Verify InWindowBlur component disables blur when hasInWindowBlur is false 3. Test build and installation with different dtk versions 4. Verify version dependency requirements in debian/control 5. Test blur rendering behavior with software renderer 6. Verify signal emission when hasInWindowBlur changes feat: 添加 hasInWindowBlur QML 属性和版本依赖 1. 为 DQMLGlobalObject 添加了新的 hasInWindowBlur 属性供 QML 访问 2. 更新 InWindowBlur 组件使用 hasInWindowBlur 来控制模糊效果开关 3. 更新 debian/control 文件增加 dtk 依赖的最低版本要求 4. 将版权年份更新为 2023-2026 Log: 新增 hasInWindowBlur QML 属性用于检测模糊可用性 Influence: 1. 测试 hasInWindowBlur 属性在不同平台上返回正确布尔值 2. 验证当 hasInWindowBlur 为 false 时 InWindowBlur 组件正确关闭模糊效果 3. 测试不同 dtk 版本下的构建和安装 4. 验证 debian/control 中的版本依赖要求 5. 测试配合软件渲染器时模糊效果的行为 6. 验证 hasInWindowBlur 变化时信号正确发射 PMS: TASK-390117 --- debian/control | 8 ++++---- qt6/src/qml/overridable/InWindowBlur.qml | 4 ++-- src/private/dqmlglobalobject.cpp | 5 +++++ src/private/dqmlglobalobject_p.h | 3 +++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/debian/control b/debian/control index 37a5f8b1c..72d10c14c 100644 --- a/debian/control +++ b/debian/control @@ -66,8 +66,8 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libdtk6declarative( =${binary:Version}), libdtk6core-dev, - libdtk6gui-dev, - libdtkcommon-dev, + libdtk6gui-dev (>> 6.7.42), + libdtkcommon-dev (>> 6.7.42), qt6-base-dev, qt6-declarative-dev Build-Profiles: @@ -119,8 +119,8 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, libdtkdeclarative5( =${binary:Version}), libdtkcore-dev, - libdtkgui-dev, - libdtkcommon-dev, + libdtkgui-dev (>> 5.7.42), + libdtkcommon-dev (>> 5.7.42), qtbase5-dev, qtdeclarative5-dev Build-Profiles: diff --git a/qt6/src/qml/overridable/InWindowBlur.qml b/qt6/src/qml/overridable/InWindowBlur.qml index fbadcce52..a6eab580a 100644 --- a/qt6/src/qml/overridable/InWindowBlur.qml +++ b/qt6/src/qml/overridable/InWindowBlur.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2023 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -18,7 +18,7 @@ Item { D.BackdropBlitter { id: blitter anchors.fill: parent - blitterEnabled: !D.DTK.isSoftwareRender + blitterEnabled: !D.DTK.isSoftwareRender && D.DTK.hasInWindowBlur MultiEffect { id: blur diff --git a/src/private/dqmlglobalobject.cpp b/src/private/dqmlglobalobject.cpp index 8ea840fac..3dff8ddaa 100644 --- a/src/private/dqmlglobalobject.cpp +++ b/src/private/dqmlglobalobject.cpp @@ -221,6 +221,11 @@ bool DQMLGlobalObject::hasAnimation() return DGuiApplicationHelper::testAttribute(DGuiApplicationHelper::HasAnimations); } +bool DQMLGlobalObject::hasInWindowBlur() +{ + return DGuiApplicationHelper::testAttribute(DGuiApplicationHelper::HasInWindowBlur); +} + bool DQMLGlobalObject::isSoftwareRender() { static bool isSoftware = QQuickWindow::sceneGraphBackend() == QLatin1String("software"); diff --git a/src/private/dqmlglobalobject_p.h b/src/private/dqmlglobalobject_p.h index b40f92e88..e2d24d55b 100644 --- a/src/private/dqmlglobalobject_p.h +++ b/src/private/dqmlglobalobject_p.h @@ -120,6 +120,7 @@ class DQMLGlobalObject : public QObject, public DTK_CORE_NAMESPACE::DObject Q_PROPERTY(bool hasComposite READ hasComposite NOTIFY hasCompositeChanged) Q_PROPERTY(bool hasNoTitlebar READ hasNoTitlebar NOTIFY hasNoTitlebarChanged) Q_PROPERTY(bool hasAnimation READ hasAnimation NOTIFY hasAnimationChanged) + Q_PROPERTY(bool hasInWindowBlur READ hasInWindowBlur NOTIFY hasInWindowBlurChanged) Q_PROPERTY(bool isSoftwareRender READ isSoftwareRender FINAL CONSTANT) Q_PROPERTY(DTK_GUI_NAMESPACE::DWindowManagerHelper::WMName windowManagerName READ windowManagerName CONSTANT) Q_PROPERTY(DTK_GUI_NAMESPACE::DGuiApplicationHelper::ColorType themeType READ themeType NOTIFY themeTypeChanged) @@ -185,6 +186,7 @@ class DQMLGlobalObject : public QObject, public DTK_CORE_NAMESPACE::DObject bool hasComposite() const; bool hasNoTitlebar() const; static bool hasAnimation(); + static bool hasInWindowBlur(); static bool isSoftwareRender(); DWindowManagerHelper::WMName windowManagerName() const; @@ -252,6 +254,7 @@ class DQMLGlobalObject : public QObject, public DTK_CORE_NAMESPACE::DObject void hasCompositeChanged(); void hasNoTitlebarChanged(); void hasAnimationChanged(); + void hasInWindowBlurChanged(); void paletteChanged(); void inactivePaletteChanged(); void themeTypeChanged(DTK_GUI_NAMESPACE::DGuiApplicationHelper::ColorType themeType);