From 59f6731d8676be16e31bccd6ef1f10b552d86f5b Mon Sep 17 00:00:00 2001 From: Cloud Date: Thu, 20 Aug 2026 20:52:19 +0800 Subject: [PATCH 01/31] fix: install DLL to bin directory on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Separate install destinations for LIBRARY, ARCHIVE and RUNTIME to ensure DLL files are installed to the bin directory on Windows instead of lib. fix: Windows 平台 DLL 安装到 bin 目录 分离 LIBRARY、ARCHIVE 和 RUNTIME 的安装路径,确保 Windows 平台的 DLL 文件安装到 bin 目录而非 lib 目录。 --- qt6/src/CMakeLists.txt | 6 +++++- src/CMakeLists.txt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/qt6/src/CMakeLists.txt b/qt6/src/CMakeLists.txt index 065b2a00e..3348bb514 100644 --- a/qt6/src/CMakeLists.txt +++ b/qt6/src/CMakeLists.txt @@ -81,7 +81,11 @@ set_target_properties(${PLUGIN_NAME} PROPERTIES ) # Install library -install(TARGETS ${LIB_NAME} EXPORT Dtk${DTK_NAME_SUFFIX}DeclarativeTargets DESTINATION "${LIB_INSTALL_DIR}") +install(TARGETS ${LIB_NAME} EXPORT Dtk${DTK_NAME_SUFFIX}DeclarativeTargets + LIBRARY DESTINATION "${LIB_INSTALL_DIR}" + ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" +) # Install export targets install(EXPORT Dtk${DTK_NAME_SUFFIX}DeclarativeTargets NAMESPACE Dtk${DTK_NAME_SUFFIX}:: FILE Dtk${DTK_NAME_SUFFIX}DeclarativeTargets.cmake DESTINATION "${CONFIG_INSTALL_DIR}") # Install translations diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4a5e211b0..94b493761 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -38,6 +38,10 @@ PRIVATE install(FILES ${QM_FILES} DESTINATION "${TRANSLATIONS_INSTALL_PATH}") # Install library -install(TARGETS ${LIB_NAME} EXPORT Dtk${DTK_NAME_SUFFIX}DeclarativeTargets DESTINATION "${LIB_INSTALL_DIR}") +install(TARGETS ${LIB_NAME} EXPORT Dtk${DTK_NAME_SUFFIX}DeclarativeTargets + LIBRARY DESTINATION "${LIB_INSTALL_DIR}" + ARCHIVE DESTINATION "${LIB_INSTALL_DIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" +) # Install export targets install(EXPORT Dtk${DTK_NAME_SUFFIX}DeclarativeTargets NAMESPACE Dtk${DTK_NAME_SUFFIX}:: FILE Dtk${DTK_NAME_SUFFIX}DeclarativeTargets.cmake DESTINATION "${CONFIG_INSTALL_DIR}") From 78051cf410f995aac03527ba8ed3964884fa7b65 Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Wed, 26 Aug 2026 13:26:06 +0800 Subject: [PATCH 02/31] i18n: [dtkdeclarative] Updates for project Deepin Tool Kit (#669) * i18n: Translate dtkdeclarative.ts in pt 71% of minimum 10% translated source file: 'dtkdeclarative.ts' on 'pt'. Sync of partially translated files: untranslated content is included with an empty translation or source language content depending on file format * i18n: Translate dtkdeclarative.ts in ar 100% translated source file: 'dtkdeclarative.ts' on 'ar'. --------- Log: --- src/translations/dtkdeclarative_ar.ts | 12 ++++++------ src/translations/dtkdeclarative_pt.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/translations/dtkdeclarative_ar.ts b/src/translations/dtkdeclarative_ar.ts index 8ba7f8b68..8ecc059b8 100644 --- a/src/translations/dtkdeclarative_ar.ts +++ b/src/translations/dtkdeclarative_ar.ts @@ -32,7 +32,7 @@ Sincerely appreciate the %1 used. - + نشكركم بصدق على استخدام %1 @@ -77,17 +77,17 @@ Copy - + نسخ Cut - + قص Paste - + لصق @@ -97,12 +97,12 @@ Undo - + تراجع Redo - + إعادة diff --git a/src/translations/dtkdeclarative_pt.ts b/src/translations/dtkdeclarative_pt.ts index 0482b4e46..dee2cfcb6 100644 --- a/src/translations/dtkdeclarative_pt.ts +++ b/src/translations/dtkdeclarative_pt.ts @@ -37,7 +37,7 @@ open-source software - + software de código aberto @@ -53,7 +53,7 @@ open-source software - + software de código aberto From 444be1bd9a17071557b3776d498d964786902f38 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Thu, 27 Aug 2026 15:11:32 +0800 Subject: [PATCH 03/31] fix(slider): align tick labels within slider bounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Cancel the highlight panel's horizontal padding with a negative label margin so tick text stays anchored to its tick line 2. Resolve the first and last tick in TipsSlider and derive textHorizontalAlignment from them, so end labels align inward by default 3. Reach the owning TipsSlider through a single property instead of indexing parent.parent.children, which depended on declaration order 4. Drop the now-redundant explicit alignment from the example and docs Log: Tick labels no longer overflow either end of a horizontal slider Influence: Edge tick labels stay inside the slider bounds fix(slider): 修正刻度标签超出滑块范围的问题 1. 用负 margin 抵消高亮面板的水平内边距,使刻度文本紧贴其刻度线 2. 由 TipsSlider 解析首/末刻度并据此推导 textHorizontalAlignment, 两端标签默认向内对齐,使用方无需逐个显式设置 3. 通过单个属性获取所属的 TipsSlider,不再按 parent.parent.children 下标取值,摆脱对声明顺序的依赖 4. 移除示例和文档中因此变得冗余的显式对齐写法 Log: 水平滑块两端的刻度标签不再越出滑块范围 PMS: BUG-305223 Influence: 两端刻度标签保持在滑块范围内 Change-Id: I53dd9644c718df841e8ca0527f92abafc735f168 --- docs/qml/SliderTipItem.zh_CN.dox | 6 ++++-- docs/qml/TipsSlider.zh_CN.dox | 3 +-- examples/qml-inspect/Example_1.qml | 4 +--- qt6/src/qml/SliderTipItem.qml | 20 ++++++++++++++------ qt6/src/qml/TipsSlider.qml | 12 ++++++++++++ 5 files changed, 32 insertions(+), 13 deletions(-) diff --git a/docs/qml/SliderTipItem.zh_CN.dox b/docs/qml/SliderTipItem.zh_CN.dox index ef540e550..cf4e6d31a 100644 --- a/docs/qml/SliderTipItem.zh_CN.dox +++ b/docs/qml/SliderTipItem.zh_CN.dox @@ -33,8 +33,10 @@ @brief text 属性用于控制 SliderTipItem 当前显示的文本。 @property enumeration SliderTipItem::textHorizontalAlignment -@brief textHorizontalAlignment 属性用于控制 SliderTipItem 文本水平布局,默认情况下为 水平居中(Text.AlignHCenter)。 - 可使用以下枚举: Text.AlignLeft, Text.AlignRight, Text.AlignHCenter +@brief textHorizontalAlignment 属性用于控制 SliderTipItem 文本水平布局。水平方向的滑块默认按刻度位置 + 自动对齐:首个刻度左对齐(Text.AlignLeft),末个刻度右对齐(Text.AlignRight),其余居中 + (Text.AlignHCenter),以避免两端文本越出滑块范围;垂直方向的滑块默认水平居中。 + 显式赋值可覆盖默认行为,可使用以下枚举: Text.AlignLeft, Text.AlignRight, Text.AlignHCenter @property enumeration SliderTipItem::direction @note 只读属性 diff --git a/docs/qml/TipsSlider.zh_CN.dox b/docs/qml/TipsSlider.zh_CN.dox index 891207046..bb18b4439 100644 --- a/docs/qml/TipsSlider.zh_CN.dox +++ b/docs/qml/TipsSlider.zh_CN.dox @@ -41,10 +41,10 @@ TipsSlider 添加字符标签 slider.to: 20 slider.value: 10 + // 首/末刻度文本默认自动左/右对齐,无需显式设置 textHorizontalAlignment ticks: [ SliderTipItem { text: slider.tips[0] - textHorizontalAlignment: Text.AlignLeft }, SliderTipItem { highlight: true @@ -52,7 +52,6 @@ TipsSlider 添加字符标签 }, SliderTipItem { text: slider.tips[2] - textHorizontalAlignment: Text.AlignRight } ] } diff --git a/examples/qml-inspect/Example_1.qml b/examples/qml-inspect/Example_1.qml index 12bffc148..47ff510bc 100644 --- a/examples/qml-inspect/Example_1.qml +++ b/examples/qml-inspect/Example_1.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -370,7 +370,6 @@ Item { ticks: [SliderTipItem { text: sliderTickTip3.tips[0] - textHorizontalAlignment: Text.AlignLeft }, SliderTipItem { text: sliderTickTip3.tips[1] @@ -389,7 +388,6 @@ Item { }, SliderTipItem { text: sliderTickTip3.tips[6] - textHorizontalAlignment: Text.AlignRight }] // test end Indicator diff --git a/qt6/src/qml/SliderTipItem.qml b/qt6/src/qml/SliderTipItem.qml index 0ea1e8454..c8134bbee 100644 --- a/qt6/src/qml/SliderTipItem.qml +++ b/qt6/src/qml/SliderTipItem.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -9,10 +9,16 @@ import org.deepin.dtk.style 1.0 as DS Control { id: control + readonly property Item __tipsSlider: parent ? parent.parent : null + property string text - property int textHorizontalAlignment: Text.AlignHCenter - readonly property int direction: parent.parent.tickDirection - readonly property bool horizontal: parent.parent.children[0].horizontal + property int textHorizontalAlignment: !horizontal || !__tipsSlider ? Text.AlignHCenter + : control === __tipsSlider.__firstTick ? Text.AlignLeft + : control === __tipsSlider.__lastTick ? Text.AlignRight + : Text.AlignHCenter + readonly property int direction: __tipsSlider ? __tipsSlider.tickDirection + : TipsSlider.TickDirection.Back + readonly property bool horizontal: __tipsSlider ? __tipsSlider.slider.horizontal : true property bool highlight property D.Palette tickColor: DS.Style.slider.tick.background @@ -41,10 +47,12 @@ Control { bottomMargin: horizontal && (TipsSlider.TickDirection.Front === direction) ? DS.Style.slider.tick.vPadding : undefined left: horizontal ? (Text.AlignLeft === textHorizontalAlignment ? __rect.left : undefined) : (TipsSlider.TickDirection.Back === direction ? __rect.right : undefined) - leftMargin: !horizontal && TipsSlider.TickDirection.Back === direction ? DS.Style.slider.tick.hPadding : undefined + leftMargin: horizontal ? (highlight ? -DS.Style.slider.tick.hPadding : 0) + : (TipsSlider.TickDirection.Back === direction ? DS.Style.slider.tick.hPadding : undefined) right: horizontal ? (Text.AlignRight === textHorizontalAlignment ? __rect.right : undefined) : (TipsSlider.TickDirection.Front === direction ? __rect.left : undefined) - rightMargin: !horizontal && TipsSlider.TickDirection.Front === direction ? DS.Style.slider.tick.hPadding : undefined + rightMargin: horizontal ? (highlight ? -DS.Style.slider.tick.hPadding : 0) + : (TipsSlider.TickDirection.Front === direction ? DS.Style.slider.tick.hPadding : undefined) horizontalCenter: horizontal && Text.AlignHCenter === textHorizontalAlignment ? __rect.horizontalCenter : undefined verticalCenter: horizontal ? undefined : __rect.verticalCenter } diff --git a/qt6/src/qml/TipsSlider.qml b/qt6/src/qml/TipsSlider.qml index da236f2b9..6bb959a0a 100644 --- a/qt6/src/qml/TipsSlider.qml +++ b/qt6/src/qml/TipsSlider.qml @@ -16,6 +16,18 @@ Control { property alias ticks: ticksGrid.children property int tickDirection: (TipsSlider.TickDirection.Back) + readonly property Item __firstTick: __edgeTick(false) + readonly property Item __lastTick: __edgeTick(true) + + function __edgeTick(fromEnd) { + for (var i = 0; i < ticks.length; ++i) { + var tick = ticks[fromEnd ? ticks.length - 1 - i : i] + if (tick instanceof D.SliderTipItem) + return tick + } + return null + } + implicitWidth: __slider.width + (__slider.horizontal ? 0 : ticksGrid.childrenRect.width) implicitHeight: __slider.height + (__slider.horizontal ? ticksGrid.childrenRect.height : 0) From d0de769cc8f31081907de58d72de258801026f61 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Mon, 31 Aug 2026 17:17:21 +0800 Subject: [PATCH 04/31] fix(arrowlistview): fix ArrowListView height oscillation and item clipping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Show arrow buttons constantly when interactive, grey them out via internal enabled instead of hiding them, so layout height stays fixed 2. Size the viewport by real item height (contentHeight / count) rather than the static style itemHeight, so the last visible item is not clipped 3. Simplify the interactive condition to model.count vs maxVisibleItems 4. Use implicitHeight for the button layout preferred height Log: Fix ArrowListView height fluctuating while scrolling and the last item being clipped when actual item height differs from itemHeight Influence: Lists in menus and ComboBoxes no longer resize during scroll fix(arrowlistview): 修复 ArrowListView 滚动时高度振荡与末项被裁剪 1. 箭头按钮改为占用布局后通过内部 enabled 置灰,避免隐藏按钮改变高度 2. 视口改用真实项高(contentHeight/count)计算,替换静态 itemHeight, 使最后一个可见项不被裁剪 3. interactive 改用 count 与 maxVisibleItems 比较 4. 按钮布局期望高度改用 implicitHeight Log: 修复列表滚动时高度抖动以及实际项高与 itemHeight 不一致时末项被裁剪 PMS: BUG-375249 Influence: 菜单/下拉列表滚动时不再跳动,末项完整显示 Change-Id: I09a7ef250f82eebf20784336301d24789cad99e6 --- qt6/src/qml/ArrowListView.qml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/qt6/src/qml/ArrowListView.qml b/qt6/src/qml/ArrowListView.qml index bba7de237..11726cb06 100644 --- a/qt6/src/qml/ArrowListView.qml +++ b/qt6/src/qml/ArrowListView.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -22,10 +22,10 @@ FocusScope { id: contentLayout anchors.fill: parent P.ArrowListViewButton { - visible: itemsView.interactive && !itemsView.atYBeginning + visible: itemsView.interactive Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - Layout.preferredHeight: height + Layout.preferredHeight: implicitHeight view: itemsView stepSize: control.itemHeight direction: P.ArrowListViewButton.UpButton @@ -36,7 +36,7 @@ FocusScope { clip: true Layout.fillWidth: true Layout.fillHeight: true - implicitHeight: Math.min(contentHeight, maxVisibleItems * itemHeight) + implicitHeight: itemsView.count > 0 ? Math.min(contentHeight, maxVisibleItems * contentHeight / itemsView.count) : 0 implicitWidth:{ var maxWidth = DS.Style.arrowListView.width for (var i = 0; i < itemsView.count; ++i) { @@ -46,7 +46,7 @@ FocusScope { } return maxWidth } - interactive: Window.window ? (contentHeight > Window.window.height || model.count > maxVisibleItems) : false + interactive: model.count > maxVisibleItems ScrollIndicator.vertical: ScrollIndicator { } highlight: HighlightPanel { visible: false // TODO listview's highlight is confict with Item's highlight. @@ -78,10 +78,10 @@ FocusScope { } P.ArrowListViewButton { - visible: itemsView.interactive && !itemsView.atYEnd + visible: itemsView.interactive Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - Layout.preferredHeight: height + Layout.preferredHeight: implicitHeight view: itemsView stepSize: control.itemHeight direction: P.ArrowListViewButton.DownButton From 43f8b3bd50cd4bcdb0060b9a25017ad13aaad53c Mon Sep 17 00:00:00 2001 From: 52cyb Date: Tue, 18 Aug 2026 13:48:35 +0800 Subject: [PATCH 05/31] fix(slider): add NoArrowType case in SliderHandle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Add NoArrowType case to getIconNameByType in SliderHandle.qml (qt6) 2. NoArrowType falls through to default returning empty string 3. Default branch covers future enum values with empty-string return 4. Empty name avoids undefined being assigned to DciIcon.name (QString) 5. Empty name matches C++ name.isEmpty() sentinel to skip DCI drawing 6. Only the Qt6 path is changed; Qt5 Slider.qml has no NoArrowType enum 7. Update SPDX-FileCopyrightText year range to 2022 - 2026 Influence: 1. Open control-center Sound page; no undefined-to-QString warning 2. Verify microphone input-level slider renders with no residual icon 3. Confirm existing handleTypes (Arrow/NoArrowH/NoArrowV) unchanged fix(slider): 在 SliderHandle 中补充 NoArrowType 分支 1. 在 qt6 SliderHandle.qml 的 getIconNameByType 中补充 NoArrowType 分支 2. NoArrowType fall-through 到 default 分支,共享一个空串返回 3. default 分支返回空串,覆盖未来新增枚举值 4. 空串避免 undefined 赋给 DciIcon.name 的 QString 5. 空串与 C++ 侧 name.isEmpty() 跳过 DCI 绘制的哨兵判定保持一致 6. 仅改动 Qt6 路径;Qt5 的 Slider.qml 不存在 NoArrowType 枚举 7. 更新 SPDX-FileCopyrightText 年份范围为 2022 - 2026 Influence: 1. 打开控制中心-声音页,确认不再出现 undefined-to-QString 告警 2. 验证麦克风输入等级反馈滑块渲染正常、无残留图标 3. 确认其他 handleType(Arrow/NoArrowHorizontal/NoArrowVertical)行为不变 PMS: Task-392413 --- qt6/src/qml/SliderHandle.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qt6/src/qml/SliderHandle.qml b/qt6/src/qml/SliderHandle.qml index c025512bd..a88a0b8a0 100644 --- a/qt6/src/qml/SliderHandle.qml +++ b/qt6/src/qml/SliderHandle.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -24,6 +24,9 @@ D.DciIcon { return "slider_point_left" case Slider.HandleType.ArrowRight: return "slider_point_left" + case Slider.HandleType.NoArrowType: + default: + return "" } } From 576f425f4d3746237f568451926b236f38b9d727 Mon Sep 17 00:00:00 2001 From: svan71 <48870638+svan71@users.noreply.github.com> Date: Sat, 11 Jul 2026 01:53:08 -0400 Subject: [PATCH 06/31] fix: compare winId consistently in _q_onWindowMotifHintsChanged The slot receives winId as quint32 (eventFilter and the DWindowManagerHelper windowMotifWMHintsChanged signal both deliver it truncated to 32 bits), but the identity guard compared it against the full-width WId from QWindow::winId(). On X11 WId is a 32-bit XID so it worked; on Wayland/Qt6.11 WId is a 64-bit pointer (>4GiB), so the guard is always true and the slot returns before fetching Motif functions, leaving motifFunctions at 0 and disabling the minimize/close buttons on DTK client titlebars (e.g. dde-control-center). --- src/dquickwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dquickwindow.cpp b/src/dquickwindow.cpp index de0a3bc08..4988bc1dd 100644 --- a/src/dquickwindow.cpp +++ b/src/dquickwindow.cpp @@ -215,7 +215,7 @@ void DQuickWindowAttachedPrivate::_q_onWindowMotifHintsChanged(quint32 winId) if (!q->window()) return; - if (q->window()->winId() != winId) + if (static_cast(q->window()->winId()) != winId) return; auto functions_hints = DWindowManagerHelper::getMotifFunctions(q->window()); From 2ac5a3956ad3b00a7fd625cf78eabdfeaab684a1 Mon Sep 17 00:00:00 2001 From: liujiangtao Date: Mon, 7 Sep 2026 14:34:47 +0800 Subject: [PATCH 07/31] fix(dciicon): restore smooth filtering for mixed-DPI scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the scale-based setSmooth(false) overrides in DQuickDciIconImage so icons fall back to the default smooth=true filtering, eliminating jaggies when the scene is downsampled to lower-DPI outputs. Forward IconLabel's smooth to its internal image. 移除DQuickDciIconImage中基于scale的smooth强制覆盖,恢复默认平滑过滤, 修复混合DPI下场景降采样导致的图标锯齿。IconLabel的smooth转发到内部图像。 Log: 修复混合DPI下图标锯齿,恢复DciIcon平滑渲染 Influence: 所有使用DciIcon/IconLabel的控件在混合DPI下图标平滑渲染;外部可通过smooth属性控制图标过滤。 --- src/private/dquickdciiconimage.cpp | 2 -- src/private/dquickiconlabel.cpp | 6 +++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/private/dquickdciiconimage.cpp b/src/private/dquickdciiconimage.cpp index c7a7a9781..53f131a19 100644 --- a/src/private/dquickdciiconimage.cpp +++ b/src/private/dquickdciiconimage.cpp @@ -266,7 +266,6 @@ DQuickDciIconImage::DQuickDciIconImage(QQuickItem *parent) connect(this, &DQuickDciIconImage::smoothChanged, d->imageItem, &QQuickImage::setSmooth); connect(d->imageItem, &QQuickItem::widthChanged, this, [d]() { d->scheduleLayout(); }); connect(d->imageItem, &QQuickItem::heightChanged, this, [d]() { d->scheduleLayout(); }); - connect(this, &QQuickItem::scaleChanged, this, [this]() {setSmooth(!qFuzzyCompare(scale(), 1.0)); }); } DQuickDciIconImage::~DQuickDciIconImage() @@ -485,7 +484,6 @@ void DQuickDciIconImage::componentComplete() D_D(DQuickDciIconImage); d->imageItem->componentComplete(); QQuickItem::componentComplete(); - setSmooth(!qFuzzyCompare(scale(), 1.0)); d->layout(); } diff --git a/src/private/dquickiconlabel.cpp b/src/private/dquickiconlabel.cpp index fd0a4a923..f7144752b 100644 --- a/src/private/dquickiconlabel.cpp +++ b/src/private/dquickiconlabel.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2020 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -53,6 +53,10 @@ void DQuickIconLabelPrivate::createIconImage() image->setMode(icon.mode()); image->setFallbackToQIcon(icon.fallbackToQIcon()); image->imageItem()->setFallbackSource(icon.source()); + // Keep the label's smooth property in sync with the internal image so that + // setting IconLabel.smooth in QML controls the icon's texture filtering. + image->setSmooth(q->smooth()); + QObject::connect(q, &QQuickItem::smoothChanged, image, &QQuickItem::setSmooth); #if QT_VERSION >= QT_VERSION_CHECK(6, 8, 0) image->setRetainWhileLoading(true); #endif From 7c97a95a21029167d2f1b157977bb6438aba3ed1 Mon Sep 17 00:00:00 2001 From: liujiangtao Date: Fri, 4 Sep 2026 18:28:06 +0800 Subject: [PATCH 08/31] fix(dciicon): restore smooth filtering for mixed-DPI scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bind smooth: control.smooth on every direct DciIcon used by controls, covering indicator/arrow/handle icons (CheckDelegate, ItemDelegate, MenuItem, CheckBox, RadioButton, Switch, ComboBox, ButtonIndicator, SpinBoxIndicator, SliderHandle, ActionButton, IconButton, WindowButton, DialogTitleBar, TitleBar, SearchEdit) so controls consistently honor their public smooth property. IconLabel.smooth already forwards to the internal image. 在所有控件直接使用的DciIcon(指示器/箭头/手柄图标)上绑定 smooth: control.smooth,使控件一致响应公开的smooth属性,修复 control.smooth为false时指示器/箭头仍保持平滑过滤的问题。 Log: 补全控件直接DciIcon的smooth绑定,修复smooth属性不一致 Influence: 所有使用DciIcon指示器/箭头的控件现在能通过control.smooth一致控制图标过滤;混合DPI下图标平滑渲染行为不变。 --- qt6/src/qml/AboutDialog.qml | 1 + qt6/src/qml/ActionButton.qml | 3 ++- qt6/src/qml/Button.qml | 3 ++- qt6/src/qml/ButtonIndicator.qml | 3 ++- qt6/src/qml/CheckBox.qml | 4 +++- qt6/src/qml/CheckDelegate.qml | 4 +++- qt6/src/qml/ComboBox.qml | 3 +++ qt6/src/qml/ControlGroup.qml | 3 ++- qt6/src/qml/DialogTitleBar.qml | 1 + qt6/src/qml/IconButton.qml | 3 ++- qt6/src/qml/ItemDelegate.qml | 4 +++- qt6/src/qml/MenuItem.qml | 5 ++++- qt6/src/qml/RadioButton.qml | 4 +++- qt6/src/qml/SearchEdit.qml | 3 ++- qt6/src/qml/Slider.qml | 1 + qt6/src/qml/SpinBoxIndicator.qml | 3 ++- qt6/src/qml/Switch.qml | 4 +++- qt6/src/qml/TitleBar.qml | 3 ++- qt6/src/qml/ToolButton.qml | 3 ++- qt6/src/qml/WindowButton.qml | 1 + src/qml/AboutDialog.qml | 3 ++- src/qml/ActionButton.qml | 3 ++- src/qml/Button.qml | 3 ++- src/qml/ButtonIndicator.qml | 3 ++- src/qml/CheckBox.qml | 4 +++- src/qml/CheckDelegate.qml | 4 +++- src/qml/ComboBox.qml | 5 ++++- src/qml/DialogTitleBar.qml | 3 ++- src/qml/IconButton.qml | 3 ++- src/qml/ItemDelegate.qml | 4 +++- src/qml/MenuItem.qml | 5 ++++- src/qml/RadioButton.qml | 4 +++- src/qml/SearchEdit.qml | 3 ++- src/qml/Slider.qml | 3 ++- src/qml/SliderHandle.qml | 2 +- src/qml/SpinBoxIndicator.qml | 3 ++- src/qml/Switch.qml | 3 ++- src/qml/TitleBar.qml | 3 ++- src/qml/ToolButton.qml | 3 ++- src/qml/WindowButton.qml | 3 ++- 40 files changed, 91 insertions(+), 35 deletions(-) diff --git a/qt6/src/qml/AboutDialog.qml b/qt6/src/qml/AboutDialog.qml index 88ba78da8..683be880f 100644 --- a/qt6/src/qml/AboutDialog.qml +++ b/qt6/src/qml/AboutDialog.qml @@ -53,6 +53,7 @@ DialogWindow { Layout.alignment: Qt.AlignHCenter Layout.topMargin: 0 display: D.IconLabel.IconOnly + smooth: control.smooth icon.mode: control.D.ColorSelector.controlState icon.theme: control.D.ColorSelector.controlTheme icon.palette: D.DTK.makeIconPalette(control.palette) diff --git a/qt6/src/qml/ActionButton.qml b/qt6/src/qml/ActionButton.qml index 082b72bad..e735d25ad 100644 --- a/qt6/src/qml/ActionButton.qml +++ b/qt6/src/qml/ActionButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -20,6 +20,7 @@ T.Button { height: DS.Style.button.iconSize } contentItem: D.DciIcon { + smooth: control.smooth palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/qt6/src/qml/Button.qml b/qt6/src/qml/Button.qml index 60f842335..076f950aa 100644 --- a/qt6/src/qml/Button.qml +++ b/qt6/src/qml/Button.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -46,6 +46,7 @@ T.Button { width: parent.width - (indicator ? indicator.width : 0) spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: indicator ? Qt.AlignLeft | Qt.AlignVCenter : Qt.AlignCenter text: control.text diff --git a/qt6/src/qml/ButtonIndicator.qml b/qt6/src/qml/ButtonIndicator.qml index 5ac547ae7..f021bf1c0 100644 --- a/qt6/src/qml/ButtonIndicator.qml +++ b/qt6/src/qml/ButtonIndicator.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -16,6 +16,7 @@ Rectangle { color: D.ColorSelector.backgroundColor D.DciIcon { + smooth: control.smooth anchors.centerIn: parent sourceSize { width: DS.Style.buttonIndicator.iconSize diff --git a/qt6/src/qml/CheckBox.qml b/qt6/src/qml/CheckBox.qml index ded3d2813..e2378c03c 100644 --- a/qt6/src/qml/CheckBox.qml +++ b/qt6/src/qml/CheckBox.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -32,6 +32,7 @@ T.CheckBox { implicitWidth: DS.Style.checkBox.indicatorWidth implicitHeight: DS.Style.checkBox.indicatorHeight D.DciIcon { + smooth: control.smooth anchors.centerIn: parent palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState @@ -45,6 +46,7 @@ T.CheckBox { active: control.activeFocus anchors.centerIn: parent sourceComponent: D.DciIcon { + smooth: control.smooth palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/qt6/src/qml/CheckDelegate.qml b/qt6/src/qml/CheckDelegate.qml index 2345ed5ec..c6ecca964 100644 --- a/qt6/src/qml/CheckDelegate.qml +++ b/qt6/src/qml/CheckDelegate.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -31,6 +31,7 @@ T.CheckDelegate { active: indicatorVisible sourceComponent: D.DciIcon { + smooth: control.smooth palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme @@ -51,6 +52,7 @@ T.CheckDelegate { D.IconLabel { spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: control.display === D.IconLabel.IconOnly || control.display === D.IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft | Qt.AlignVCenter diff --git a/qt6/src/qml/ComboBox.qml b/qt6/src/qml/ComboBox.qml index c95281de3..cb35c3c38 100644 --- a/qt6/src/qml/ComboBox.qml +++ b/qt6/src/qml/ComboBox.qml @@ -58,6 +58,7 @@ T.ComboBox { } D.DciIcon { + smooth: control.smooth sourceSize { width: DS.Style.comboBox.edit.indicatorSize height: DS.Style.comboBox.edit.indicatorSize @@ -74,6 +75,7 @@ T.ComboBox { Component { id: normalIndicator D.DciIcon { + smooth: control.smooth sourceSize { width: DS.Style.comboBox.iconSize height: DS.Style.comboBox.iconSize @@ -96,6 +98,7 @@ T.ComboBox { active: iconName sourceComponent: D.DciIcon { + smooth: control.smooth palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/qt6/src/qml/ControlGroup.qml b/qt6/src/qml/ControlGroup.qml index 3a878540d..19cccf9b2 100644 --- a/qt6/src/qml/ControlGroup.qml +++ b/qt6/src/qml/ControlGroup.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -100,6 +100,7 @@ ColumnLayout { verticalAlignment: Qt.AlignVCenter } D.DciIcon { + smooth: title.smooth rotation: root.isExpanded ? 0 : - 90 name: "arrow_ordinary_down" mode: title.D.ColorSelector.controlState diff --git a/qt6/src/qml/DialogTitleBar.qml b/qt6/src/qml/DialogTitleBar.qml index 578570ca3..94f0e259b 100644 --- a/qt6/src/qml/DialogTitleBar.qml +++ b/qt6/src/qml/DialogTitleBar.qml @@ -66,6 +66,7 @@ Item { visible: iconLabel.name !== "" contentItem: D.DciIcon { id: iconLabel + smooth: iconControl.smooth mode: iconControl.D.ColorSelector.controlState theme: iconControl.D.ColorSelector.controlTheme palette: D.DTK.makeIconPalette(iconControl.palette) diff --git a/qt6/src/qml/IconButton.qml b/qt6/src/qml/IconButton.qml index 547f5ad62..c7492d2c5 100644 --- a/qt6/src/qml/IconButton.qml +++ b/qt6/src/qml/IconButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -24,6 +24,7 @@ Button { } contentItem: D.DciIcon { + smooth: control.smooth name: control.icon.name palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState diff --git a/qt6/src/qml/ItemDelegate.qml b/qt6/src/qml/ItemDelegate.qml index 3f9af5204..ef530a6d2 100644 --- a/qt6/src/qml/ItemDelegate.qml +++ b/qt6/src/qml/ItemDelegate.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022-2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -64,6 +64,7 @@ T.ItemDelegate { active: control.indicatorVisible && control.checked sourceComponent: D.DciIcon { + smooth: control.smooth palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme @@ -77,6 +78,7 @@ T.ItemDelegate { D.IconLabel { spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: control.display === D.IconLabel.IconOnly || control.display === D.IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft | Qt.AlignVCenter diff --git a/qt6/src/qml/MenuItem.qml b/qt6/src/qml/MenuItem.qml index ea6d6e8a3..ed61474af 100644 --- a/qt6/src/qml/MenuItem.qml +++ b/qt6/src/qml/MenuItem.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -39,6 +39,7 @@ T.MenuItem { rightPadding: control.mirrored ? Math.max(DS.Style.menu.item.contentPadding, indicatorPadding) : arrowPadding spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: Qt.AlignLeft text: control.text @@ -63,6 +64,7 @@ T.MenuItem { } sourceComponent: D.DciIcon { + smooth: control.smooth sourceSize: Qt.size(DS.Style.menu.item.iconSize.width, DS.Style.menu.item.iconSize.height) name: "menu_select" @@ -85,6 +87,7 @@ T.MenuItem { } sourceComponent: D.DciIcon { + smooth: control.smooth sourceSize: Qt.size(DS.Style.menu.item.iconSize.width, DS.Style.menu.item.iconSize.height) mirror: control.mirrored diff --git a/qt6/src/qml/RadioButton.qml b/qt6/src/qml/RadioButton.qml index c1bffb8f0..4c1e6177d 100644 --- a/qt6/src/qml/RadioButton.qml +++ b/qt6/src/qml/RadioButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -32,6 +32,7 @@ T.RadioButton { implicitHeight: implicitWidth D.DciIcon { + smooth: control.smooth anchors.centerIn: parent palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState @@ -45,6 +46,7 @@ T.RadioButton { anchors.centerIn: parent active: control.activeFocus sourceComponent: D.DciIcon { + smooth: control.smooth palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/qt6/src/qml/SearchEdit.qml b/qt6/src/qml/SearchEdit.qml index 40d755510..2b1525283 100644 --- a/qt6/src/qml/SearchEdit.qml +++ b/qt6/src/qml/SearchEdit.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2020 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -29,6 +29,7 @@ LineEdit { // Search Icon D.DciIcon { id: searchIcon + smooth: control.smooth name: "action_search" sourceSize: Qt.size(DS.Style.searchEdit.iconSize, DS.Style.searchEdit.iconSize) palette: D.DTK.makeIconPalette(control.palette) diff --git a/qt6/src/qml/Slider.qml b/qt6/src/qml/Slider.qml index 4c1e03fcd..a36d81ebb 100644 --- a/qt6/src/qml/Slider.qml +++ b/qt6/src/qml/Slider.qml @@ -38,6 +38,7 @@ T.Slider { // draw handle handle: SliderHandle { id: __handle + smooth: control.smooth x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : 0) y: control.topPadding + (control.horizontal ? 0 : control.visualPosition * (control.availableHeight - height)) width: control.horizontal ? DS.Style.slider.handle.width : DS.Style.slider.handle.height diff --git a/qt6/src/qml/SpinBoxIndicator.qml b/qt6/src/qml/SpinBoxIndicator.qml index dbe538d72..eacea3f79 100644 --- a/qt6/src/qml/SpinBoxIndicator.qml +++ b/qt6/src/qml/SpinBoxIndicator.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -30,6 +30,7 @@ Control { id: inactiveComponent D.DciIcon { id: icon + smooth: control.smooth sourceSize.width: DS.Style.spinBox.indicator.iconSize palette: D.DTK.makeIconPalette(control.palette) name: direction === SpinBoxIndicator.IndicatorDirection.UpIndicator ? "entry_spinbox_up" : "entry_spinbox_down" diff --git a/qt6/src/qml/Switch.qml b/qt6/src/qml/Switch.qml index a79a8623f..075df56fe 100644 --- a/qt6/src/qml/Switch.qml +++ b/qt6/src/qml/Switch.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -37,6 +37,7 @@ T.Switch { opacity: control.D.ColorSelector.controlState === D.DTK.DisabledState ? 0.4 : 1 D.DciIcon { + smooth: control.smooth x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) y: (parent.height - height) / 2 width: DS.Style.switchButton.handleWidth @@ -66,6 +67,7 @@ T.Switch { id: animationIndicatorComp D.DciIcon { id: switchIcon + smooth: control.smooth implicitWidth: DS.Style.switchButton.indicatorWidth implicitHeight: DS.Style.switchButton.indicatorHeight diff --git a/qt6/src/qml/TitleBar.qml b/qt6/src/qml/TitleBar.qml index 9291d3fb2..48902a9d5 100644 --- a/qt6/src/qml/TitleBar.qml +++ b/qt6/src/qml/TitleBar.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -116,6 +116,7 @@ Item { D.DciIcon { id: iconLabel + smooth: control.smooth sourceSize { width: DS.Style.titleBar.iconSize height: DS.Style.titleBar.iconSize diff --git a/qt6/src/qml/ToolButton.qml b/qt6/src/qml/ToolButton.qml index ad7ef9dc0..c48dd78e3 100644 --- a/qt6/src/qml/ToolButton.qml +++ b/qt6/src/qml/ToolButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -49,6 +49,7 @@ T.ToolButton { width: parent.width - (indicator ? indicator.width : 0) spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: indicator ? Qt.AlignLeft | Qt.AlignVCenter : Qt.AlignCenter text: control.text diff --git a/qt6/src/qml/WindowButton.qml b/qt6/src/qml/WindowButton.qml index c3e4cea2b..81e0d82a1 100644 --- a/qt6/src/qml/WindowButton.qml +++ b/qt6/src/qml/WindowButton.qml @@ -30,6 +30,7 @@ D.IconButton { leftPadding: 0 rightPadding: 0 contentItem: D.DciIcon { + smooth: control.smooth name: control.icon.name asynchronous: false palette: D.DTK.makeIconPalette(control.palette) diff --git a/src/qml/AboutDialog.qml b/src/qml/AboutDialog.qml index f1f813a85..b2553b400 100644 --- a/src/qml/AboutDialog.qml +++ b/src/qml/AboutDialog.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -43,6 +43,7 @@ DialogWindow { Layout.alignment: Qt.AlignHCenter Layout.topMargin: 0 display: D.IconLabel.IconOnly + smooth: control.smooth icon.mode: control.D.ColorSelector.controlState icon.theme: control.D.ColorSelector.controlTheme icon.palette: D.DTK.makeIconPalette(control.palette) diff --git a/src/qml/ActionButton.qml b/src/qml/ActionButton.qml index 6a6469c11..b3a98c97b 100644 --- a/src/qml/ActionButton.qml +++ b/src/qml/ActionButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -20,6 +20,7 @@ T.Button { height: DS.Style.button.iconSize } contentItem: D.DciIcon { + smooth: control.smooth palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/src/qml/Button.qml b/src/qml/Button.qml index 375e47016..941483a9d 100644 --- a/src/qml/Button.qml +++ b/src/qml/Button.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -45,6 +45,7 @@ T.Button { width: parent.width - (indicator ? indicator.width : 0) spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: indicator ? Qt.AlignLeft | Qt.AlignVCenter : Qt.AlignCenter text: control.text diff --git a/src/qml/ButtonIndicator.qml b/src/qml/ButtonIndicator.qml index 6c616731f..6279cddd3 100644 --- a/src/qml/ButtonIndicator.qml +++ b/src/qml/ButtonIndicator.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -16,6 +16,7 @@ Rectangle { color: D.ColorSelector.backgroundColor D.DciIcon { + smooth: control.smooth anchors.centerIn: parent sourceSize { width: DS.Style.buttonIndicator.iconSize diff --git a/src/qml/CheckBox.qml b/src/qml/CheckBox.qml index ac4b0fc5c..07d1df14c 100644 --- a/src/qml/CheckBox.qml +++ b/src/qml/CheckBox.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -31,6 +31,7 @@ T.CheckBox { implicitWidth: DS.Style.checkBox.indicatorWidth implicitHeight: DS.Style.checkBox.indicatorHeight D.DciIcon { + smooth: control.smooth anchors.centerIn: parent palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState @@ -44,6 +45,7 @@ T.CheckBox { active: control.activeFocus anchors.centerIn: parent sourceComponent: D.DciIcon { + smooth: control.smooth palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/src/qml/CheckDelegate.qml b/src/qml/CheckDelegate.qml index c5a67fdf9..363719df8 100644 --- a/src/qml/CheckDelegate.qml +++ b/src/qml/CheckDelegate.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -29,6 +29,7 @@ T.CheckDelegate { active: control.checked sourceComponent: D.DciIcon { + smooth: control.smooth palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme @@ -42,6 +43,7 @@ T.CheckDelegate { D.IconLabel { spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: control.display === D.IconLabel.IconOnly || control.display === D.IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft | Qt.AlignVCenter diff --git a/src/qml/ComboBox.qml b/src/qml/ComboBox.qml index 8c294ad17..2f2e20538 100644 --- a/src/qml/ComboBox.qml +++ b/src/qml/ComboBox.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2020 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -52,6 +52,7 @@ T.ComboBox { } D.DciIcon { + smooth: control.smooth sourceSize { width: DS.Style.comboBox.edit.indicatorSize height: DS.Style.comboBox.edit.indicatorSize @@ -68,6 +69,7 @@ T.ComboBox { Component { id: normalIndicator D.DciIcon { + smooth: control.smooth sourceSize { width: DS.Style.comboBox.iconSize height: DS.Style.comboBox.iconSize @@ -90,6 +92,7 @@ T.ComboBox { active: iconName sourceComponent: D.DciIcon { + smooth: control.smooth palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/src/qml/DialogTitleBar.qml b/src/qml/DialogTitleBar.qml index 08e523b05..a51345aa3 100644 --- a/src/qml/DialogTitleBar.qml +++ b/src/qml/DialogTitleBar.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -66,6 +66,7 @@ Control { D.DciIcon { id: iconLabel + smooth: control.smooth visible: name !== "" mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/src/qml/IconButton.qml b/src/qml/IconButton.qml index 2551a3b7b..2e54cc996 100644 --- a/src/qml/IconButton.qml +++ b/src/qml/IconButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -23,6 +23,7 @@ Button { } contentItem: D.DciIcon { + smooth: control.smooth name: control.icon.name palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState diff --git a/src/qml/ItemDelegate.qml b/src/qml/ItemDelegate.qml index ed7cd1be8..a35a8670d 100644 --- a/src/qml/ItemDelegate.qml +++ b/src/qml/ItemDelegate.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -53,6 +53,7 @@ T.ItemDelegate { active: control.indicatorVisible && control.checked sourceComponent: D.DciIcon { + smooth: control.smooth palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme @@ -66,6 +67,7 @@ T.ItemDelegate { D.IconLabel { spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: control.display === D.IconLabel.IconOnly || control.display === D.IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft | Qt.AlignVCenter diff --git a/src/qml/MenuItem.qml b/src/qml/MenuItem.qml index 6e7a6e5cf..ed1f339af 100644 --- a/src/qml/MenuItem.qml +++ b/src/qml/MenuItem.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -38,6 +38,7 @@ T.MenuItem { rightPadding: control.mirrored ? indicatorPadding : arrowPadding spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: Qt.AlignLeft text: control.text @@ -58,6 +59,7 @@ T.MenuItem { } sourceComponent: D.DciIcon { + smooth: control.smooth sourceSize: Qt.size(DS.Style.menu.item.iconSize.width, DS.Style.menu.item.iconSize.height) name: "menu_select" @@ -80,6 +82,7 @@ T.MenuItem { } sourceComponent: D.DciIcon { + smooth: control.smooth sourceSize: Qt.size(DS.Style.menu.item.iconSize.width, DS.Style.menu.item.iconSize.height) mirror: control.mirrored diff --git a/src/qml/RadioButton.qml b/src/qml/RadioButton.qml index 926d25837..c5231fefe 100644 --- a/src/qml/RadioButton.qml +++ b/src/qml/RadioButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -31,6 +31,7 @@ T.RadioButton { implicitHeight: implicitWidth D.DciIcon { + smooth: control.smooth anchors.centerIn: parent palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState @@ -44,6 +45,7 @@ T.RadioButton { active: control.activeFocus anchors.centerIn: parent sourceComponent: D.DciIcon { + smooth: control.smooth palette: control.D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme diff --git a/src/qml/SearchEdit.qml b/src/qml/SearchEdit.qml index 9c0435999..4a1490d21 100644 --- a/src/qml/SearchEdit.qml +++ b/src/qml/SearchEdit.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2020 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -28,6 +28,7 @@ LineEdit { // Search Icon D.DciIcon { id: searchIcon + smooth: control.smooth name: "action_search" sourceSize.width: DS.Style.searchEdit.iconSize palette: D.DTK.makeIconPalette(control.palette) diff --git a/src/qml/Slider.qml b/src/qml/Slider.qml index 6fe49d10f..ae8efc785 100644 --- a/src/qml/Slider.qml +++ b/src/qml/Slider.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -36,6 +36,7 @@ T.Slider { // draw handle handle: SliderHandle { id: __handle + smooth: control.smooth x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : 0) y: control.topPadding + (control.horizontal ? 0 : control.visualPosition * (control.availableHeight - height)) width: control.horizontal ? DS.Style.slider.handle.width : DS.Style.slider.handle.height diff --git a/src/qml/SliderHandle.qml b/src/qml/SliderHandle.qml index 39587deb1..97558e89d 100644 --- a/src/qml/SliderHandle.qml +++ b/src/qml/SliderHandle.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later diff --git a/src/qml/SpinBoxIndicator.qml b/src/qml/SpinBoxIndicator.qml index 7f77fea74..34696fd27 100644 --- a/src/qml/SpinBoxIndicator.qml +++ b/src/qml/SpinBoxIndicator.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -29,6 +29,7 @@ Control { id: inactiveComponent D.DciIcon { id: icon + smooth: control.smooth sourceSize.width: DS.Style.spinBox.indicator.iconSize palette: D.DTK.makeIconPalette(control.palette) name: direction === SpinBoxIndicator.IndicatorDirection.UpIndicator ? "entry_spinbox_up" : "entry_spinbox_down" diff --git a/src/qml/Switch.qml b/src/qml/Switch.qml index 2c8f63f18..bb46fb64c 100644 --- a/src/qml/Switch.qml +++ b/src/qml/Switch.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -33,6 +33,7 @@ T.Switch { D.DciIcon { id: handle + smooth: control.smooth x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) y: (parent.height - height) / 2 width: DS.Style.switchButton.handleWidth diff --git a/src/qml/TitleBar.qml b/src/qml/TitleBar.qml index bce40fab4..e30e27dce 100644 --- a/src/qml/TitleBar.qml +++ b/src/qml/TitleBar.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -111,6 +111,7 @@ Control { D.DciIcon { id: iconLabel + smooth: control.smooth sourceSize { width: DS.Style.titleBar.iconSize height: DS.Style.titleBar.iconSize diff --git a/src/qml/ToolButton.qml b/src/qml/ToolButton.qml index aaf31f696..7a6657021 100644 --- a/src/qml/ToolButton.qml +++ b/src/qml/ToolButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -43,6 +43,7 @@ T.ToolButton { width: parent.width - (indicator ? indicator.width : 0) spacing: control.spacing mirrored: control.mirrored + smooth: control.smooth display: control.display alignment: indicator ? Qt.AlignLeft | Qt.AlignVCenter : Qt.AlignCenter text: control.text diff --git a/src/qml/WindowButton.qml b/src/qml/WindowButton.qml index d4e66c0ab..f2e79a27a 100644 --- a/src/qml/WindowButton.qml +++ b/src/qml/WindowButton.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -18,6 +18,7 @@ Control { hoverEnabled: true contentItem: D.DciIcon { id: iconLoader + smooth: control.smooth palette: D.DTK.makeIconPalette(control.palette) sourceSize { width: DS.Style.windowButton.width From 1cb9d7994ef80624f64751dbab80dfc9333341f9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Sep 2026 20:42:00 +0800 Subject: [PATCH 09/31] chore: New release 6.7.49 Log: --- CHANGELOG.md | 21 +++++++++++++++++++++ VERSION | 2 +- archlinux/PKGBUILD | 2 +- debian/changelog | 6 ++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab45c329e..fd1e7b180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.7.49] - 2026-09-10 + +### Added + +- Add NoArrowType case in SliderHandle + +### Changed + +- I18n: [dtkdeclarative] Updates for project Deepin Tool Kit (#669) + +### Fixed + +- Adjust QuickPrivate dependency for Qt 6.10+ +- Correct focus box border radius alignment +- Install DLL to bin directory on Windows +- Align tick labels within slider bounds +- Fix ArrowListView height oscillation and item clipping +- Compare winId consistently in _q_onWindowMotifHintsChanged +- Restore smooth filtering for mixed-DPI scaling +- Restore smooth filtering for mixed-DPI scaling + ## [6.7.48] - 2026-08-18 ### Changed diff --git a/VERSION b/VERSION index f421cb948..c9952ecc6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.7.48 +6.7.49 diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index 00fa592fc..a1a4c87ef 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: zccrs pkgname=dtkdeclarative-git -pkgver=6.7.48 +pkgver=6.7.49 pkgrel=1 sourcename=dtkdeclarative sourcetars=("$sourcename"_"$pkgver".tar.xz) diff --git a/debian/changelog b/debian/changelog index 12c1419c0..b4b9646b6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dtkdeclarative (6.7.49) unstable; urgency=medium + + * Release 6.7.49 + + -- yeshanshan Thu, 10 Sep 2026 20:42:00 +0800 + dtkdeclarative (6.7.48) unstable; urgency=medium * Release 6.7.48 From 15d3495839c571eb707811b491d10bfff98d75af Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 10:02:17 +0800 Subject: [PATCH 10/31] i18n: Translate dtkdeclarative.ts in sv (#674) 100% translated source file: 'dtkdeclarative.ts' on 'sv'. Log: --- src/translations/dtkdeclarative_sv.ts | 131 ++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 src/translations/dtkdeclarative_sv.ts diff --git a/src/translations/dtkdeclarative_sv.ts b/src/translations/dtkdeclarative_sv.ts new file mode 100644 index 000000000..a18ec340a --- /dev/null +++ b/src/translations/dtkdeclarative_sv.ts @@ -0,0 +1,131 @@ + + + AboutAction + + + About + Om + + + + AboutDialog + + + Version + Version + + + + Homepage + Webbplats + + + + Description + Beskrivning + + + + Acknowledgements + Tack + + + + Sincerely appreciate the %1 used. + Stort tack till %1 som används. + + + + open-source software + programvara med öppen källkod + + + + HelpAction + + + Help + Hjälp + + + + LicenseDialog + + + open-source software + programvara med öppen källkod + + + + QuitAction + + + Exit + Avsluta + + + + SearchEdit + + + Search + Sök + + + + TextField + + + Copy + Kopiera + + + + Cut + Klipp ut + + + + Paste + Klistra in + + + + Select All + Markera allt + + + + Undo + Ångra + + + + Redo + Gör om + + + + ThemeMenu + + + Theme + Tema + + + + Light Theme + Ljust tema + + + + Dark Theme + Mörkt tema + + + + System Theme + Systemtema + + + \ No newline at end of file From db82f880a0043633f81820c7ae16c67c1515a4ca Mon Sep 17 00:00:00 2001 From: wangjinrun Date: Tue, 25 Aug 2026 15:12:26 +0800 Subject: [PATCH 11/31] fix(popup): set fixed default implicit size for Window popupType MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After commit cba9773 removed the background Item's implicitWidth binding to break a binding loop, Popup's implicitWidth started tracking contentImplicitWidth directly. When popupType is Popup.Window, QQuickPopupWindow::implicitWidthChanged() unconditionally adopts popup->implicitWidth(), so search filtering that shrinks the content causes the popup window to jump to a smaller width. Instead of overriding implicitWidth/Height directly or using a ratchet mechanism, give StyledBehindWindowBlur (the Window popupType background) a fixed default implicit size — DS.Style.popup.width/height — matching the approach already used by FloatingPanel for the non-Window popupType. This provides a size floor so content shrinking no longer jumps the popup window smaller, while still allowing growth when content is larger. No binding loop because the values are constants. 修复 Popup 在 Window popupType 下宽度跳变问题 commit cba9773 移除 background Item 的 implicitWidth 绑定以消除绑定环后, Popup 的 implicitWidth 直接随 contentImplicitWidth 变化。当 popupType 为 Popup.Window 时,QQuickPopupWindow::implicitWidthChanged() 无条件采用 popup->implicitWidth(),搜索过滤导致内容减少时窗口宽度跳变。 不再直接覆盖 implicitWidth/Height 或使用棘轮机制,而是给 StyledBehindWindowBlur(Window popupType 的 background)设置固定默认隐式尺寸 —— DS.Style.popup.width/height —— 与 FloatingPanel(非 Window popupType)的 做法一致。这提供了尺寸下限,内容缩减时 popup 不再跳变到极小,内容更大时仍可 增长。值为常量,无绑定环。 PMS: BUG-373823、BUG-373843 --- qt6/src/qml/Popup.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qt6/src/qml/Popup.qml b/qt6/src/qml/Popup.qml index 6b8613332..514463228 100644 --- a/qt6/src/qml/Popup.qml +++ b/qt6/src/qml/Popup.qml @@ -17,8 +17,6 @@ T.Popup { property bool closeOnInactive: true readonly property bool active: parent && parent.Window.active - implicitWidth: DS.Style.control.implicitWidth(control) - implicitHeight: DS.Style.control.implicitHeight(control) padding: DS.Style.popup.padding @@ -28,7 +26,10 @@ T.Popup { Component { id: windowBlurComponent - D.StyledBehindWindowBlur { } + D.StyledBehindWindowBlur { + implicitWidth: DS.Style.popup.width + implicitHeight: DS.Style.popup.height + } } Component { From 6883c5afdf8a6e3ee885e79f8d7c501e7be5d657 Mon Sep 17 00:00:00 2001 From: Ivy233 Date: Fri, 18 Sep 2026 17:38:09 +0800 Subject: [PATCH 12/31] fix(popup): restore implicit size bindings on Popup for qt6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bind implicitWidth/implicitHeight to DS.Style.control.implicitWidth/implicitHeight(control), sizing the popup to the maximum of the background implicit size and the content size (plus padding and insets), consistent with the qt5 Popup. commit cba9773 removed the background Item that carried these bindings to break a binding loop, after which Popup tracked contentImplicitWidth only; commit db82f88 then gave the background a fixed default implicit size (DS.Style.popup.width/height). Since the background implicit size is now a constant, binding the popup's implicit size to DS.Style.control.implicitWidth/Height no longer forms a loop: the background default acts as a size floor, so with popupType Window, content shrinking no longer makes the popup window jump to a smaller size, while content larger than the default still grows it. fix(popup): 恢复 qt6 下 Popup 的隐式尺寸绑定 将 implicitWidth/implicitHeight 绑定到 DS.Style.control.implicitWidth/implicitHeight(control),取 background 隐式尺寸与内容尺寸(加上 padding/insets)的最大值作为 Popup 的隐式尺寸, 与 qt5 版 Popup 保持一致。 commit cba9773 为消除绑定环移除了承载该绑定的 background Item,此后 Popup 仅随 contentImplicitWidth 变化;commit db82f88 随后为 background 设置了固定默认隐式尺寸(DS.Style.popup.width/height)。由于 background 隐式尺寸已是常量,将 Popup 隐式尺寸绑定到 DS.Style.control.implicitWidth/Height 不再形成绑定环:background 默认 值充当尺寸下限,popupType 为 Window 时内容缩减不再使 popup 窗口跳变 变小,内容更大时仍可增长。 PMS: BUG-373823、BUG-373843 --- qt6/src/qml/Popup.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qt6/src/qml/Popup.qml b/qt6/src/qml/Popup.qml index 514463228..a05b451ef 100644 --- a/qt6/src/qml/Popup.qml +++ b/qt6/src/qml/Popup.qml @@ -18,6 +18,9 @@ T.Popup { property bool closeOnInactive: true readonly property bool active: parent && parent.Window.active + implicitWidth: DS.Style.control.implicitWidth(control) + implicitHeight: DS.Style.control.implicitHeight(control) + padding: DS.Style.popup.padding background: Loader { From b8ee7b18b5f978e901518bb38b783be2efa13dc8 Mon Sep 17 00:00:00 2001 From: Wu JiangYu Date: Sun, 20 Sep 2026 10:48:57 +0800 Subject: [PATCH 13/31] fix: correct model reference in ArrowListView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Change interactive property binding from model.count to itemsView.count 2. The ListView is assigned id itemsView, so model is not a valid reference 3. This fixes the interactive property to correctly enable scrolling when items exceed maxVisibleItems 4. Without this fix, the interactive property would fail to bind correctly, potentially disabling scroll interaction Influence: 1. Test ArrowListView with item count exceeding maxVisibleItems to verify scrolling works 2. Test ArrowListView with item count equal to or less than maxVisibleItems to verify scrolling is disabled 3. Verify the list view displays and scrolls correctly with various item counts 4. Test keyboard and mouse wheel navigation within the list fix: 修正 ArrowListView 中的模型引用 1. 将 interactive 属性绑定从 model.count 改为 itemsView.count 2. ListView 的 id 为 itemsView,因此 model 不是有效的引用 3. 修复了 interactive 属性,使其在项目数超过 maxVisibleItems 时正确启用 滚动 4. 如果不修复,interactive 属性将无法正确绑定,可能导致滚动交互被禁用 Influence: 1. 测试项目数超过 maxVisibleItems 时的 ArrowListView 滚动功能 2. 测试项目数等于或少于 maxVisibleItems 时滚动是否被禁用 3. 验证列表视图在不同项目数量下的显示和滚动是否正常 4. 测试列表中的键盘和鼠标滚轮导航 PMS: BUG-388693 --- qt6/src/qml/ArrowListView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qt6/src/qml/ArrowListView.qml b/qt6/src/qml/ArrowListView.qml index 11726cb06..f6b2eace5 100644 --- a/qt6/src/qml/ArrowListView.qml +++ b/qt6/src/qml/ArrowListView.qml @@ -46,7 +46,7 @@ FocusScope { } return maxWidth } - interactive: model.count > maxVisibleItems + interactive: itemsView.count > maxVisibleItems ScrollIndicator.vertical: ScrollIndicator { } highlight: HighlightPanel { visible: false // TODO listview's highlight is confict with Item's highlight. From 660a12bd6b79beacfd108f3588133fb7d38824bb Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Fri, 11 Sep 2026 17:46:49 +0800 Subject: [PATCH 14/31] feat: add split screen menu to title bar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Add splitScreenEnabled property to TitleBar and WindowButtonGroup components 2. Implement showSplitMenu and hideSplitMenu methods in DQuickWindowAttached 3. Add platform function bindings for _d_supportSplitMenu, _d_showSplitMenu, and _d_hideSplitMenu 4. Add hover timer (700ms) and hold timer (300ms) to trigger split menu on maximize button 5. Track splitMenuWindowId in DQuickWindowPrivate to manage menu state 6. Handle menu lifecycle on hover, press, release, cancel, visibility and enabled changes 7. Map button geometry to global coordinates for menu positioning Log: Added split screen menu triggered by hovering or long-pressing the maximize button Influence: 1. Test hovering over maximize button for 700ms to show split screen menu 2. Test long-pressing maximize button for 300ms to trigger split menu 3. Verify normal click behavior on maximize button still works when not long-pressed 4. Test menu hides on mouse leave and when splitScreenEnabled is set to false 5. Verify split menu only appears when platform supports _d_supportSplitMenu 6. Test split menu positioning aligns with the maximize button location 7. Verify menu interaction works correctly in embed mode and fullscreen scenarios 8. Test behavior when window is not visible or button is disabled feat: 为标题栏添加分屏菜单 1. 在 TitleBar 和 WindowButtonGroup 组件中添加 splitScreenEnabled 属性 2. 在 DQuickWindowAttached 中实现 showSplitMenu 和 hideSplitMenu 方法 3. 添加 _d_supportSplitMenu、_d_showSplitMenu 和 _d_hideSplitMenu 平台函 数绑定 4. 为最大化按钮添加悬停定时器(700ms)和长按定时器(300ms)以触发分屏 菜单 5. 在 DQuickWindowPrivate 中跟踪 splitMenuWindowId 以管理菜单状态 6. 在悬停、按下、释放、取消、可见性和启用状态变化时处理菜单生命周期 7. 将按钮几何位置映射到全局坐标以定位菜单 Log: 新增通过悬停或长按最大化按钮触发的分屏菜单 Influence: 1. 测试悬停最大化按钮 700ms 后显示分屏菜单 2. 测试长按最大化按钮 300ms 触发分屏菜单 3. 验证非长按时最大化按钮的正常点击行为仍然有效 4. 测试鼠标离开和 splitScreenEnabled 设为 false 时菜单隐藏 5. 验证仅在平台支持 _d_supportSplitMenu 时才显示分屏菜单 6. 测试分屏菜单位置是否与最大化按钮位置对齐 7. 验证嵌入模式和全屏场景下菜单交互正常 8. 测试窗口不可见或按钮禁用时的行为 PMS: BUG-370181 --- qt6/src/qml/TitleBar.qml | 2 + qt6/src/qml/WindowButtonGroup.qml | 79 ++++++++++++++++++++++++++++++- src/dquickwindow.cpp | 41 ++++++++++++++++ src/dquickwindow.h | 3 ++ src/private/dquickwindow_p.h | 1 + 5 files changed, 125 insertions(+), 1 deletion(-) diff --git a/qt6/src/qml/TitleBar.qml b/qt6/src/qml/TitleBar.qml index 48902a9d5..68bbf07b4 100644 --- a/qt6/src/qml/TitleBar.qml +++ b/qt6/src/qml/TitleBar.qml @@ -28,6 +28,7 @@ Item { // visibility access property bool fullScreenButtonVisible: true + property bool splitScreenEnabled: true signal toggleWindowState() property alias windowButtonGroup: windowButtonsLoader.sourceComponent @@ -179,6 +180,7 @@ Item { embedMode: control.embedMode textColor: control.textColor fullScreenButtonVisible: control.fullScreenButtonVisible + splitScreenEnabled: control.splitScreenEnabled Component.onCompleted: { control.toggleWindowState.connect(maxOrWinded) } diff --git a/qt6/src/qml/WindowButtonGroup.qml b/qt6/src/qml/WindowButtonGroup.qml index a86a9de13..8d1cdd346 100644 --- a/qt6/src/qml/WindowButtonGroup.qml +++ b/qt6/src/qml/WindowButtonGroup.qml @@ -14,6 +14,7 @@ RowLayout { property D.Palette textColor: DS.Style.button.text property bool fullScreenButtonVisible: true + property bool splitScreenEnabled: true property bool embedMode: false signal maxOrWinded() @@ -76,6 +77,7 @@ RowLayout { WindowButton { id: maxOrWindedBtn; objectName: "maxOrWindedBtn" + hoverEnabled: true property bool hasWindowFlag/*: (Window.window.flags & Qt.WindowMaximizeButtonHint)*/ Component.onCompleted: hasWindowFlag = (Window.window.flags & Qt.WindowMaximizeButtonHint) @@ -86,7 +88,82 @@ RowLayout { property bool isMaximized: Window.window.visibility === Window.Maximized icon.name: isMaximized ? "window_restore" : "window_maximize" textColor: control.textColor - onClicked: maxOrWinded() + property bool __longPressed: false + property bool __menuRequested: false + + function showSplitMenu() { + if (!control.splitScreenEnabled || !visible || !enabled) + return false + if (!__menuRequested) + __menuRequested = control.__dwindow.showSplitMenu(maxOrWindedBtn) + return __menuRequested + } + + function hideSplitMenu(delay) { + hoverTimer.stop() + holdTimer.stop() + control.__dwindow.hideSplitMenu(delay) + __menuRequested = false + } + + onHoveredChanged: { + if (hovered && !pressed) + hoverTimer.restart() + else if (!hovered) { + hoverTimer.stop() + if (pressed) + holdTimer.stop() + else + hideSplitMenu(true) + } + } + onPressed: { + __longPressed = false + hoverTimer.stop() + holdTimer.restart() + } + onReleased: { + holdTimer.stop() + if (!__longPressed) + hideSplitMenu(false) + else + __menuRequested = false + } + onCanceled: { + hideSplitMenu(true) + __longPressed = false + } + onClicked: { + if (!__longPressed) + control.maxOrWinded() + __longPressed = false + } + onVisibleChanged: { + if (!visible) { + hoverTimer.stop() + holdTimer.stop() + __menuRequested = false + } + } + onEnabledChanged: if (!enabled) hideSplitMenu(false) + + Timer { + id: hoverTimer + interval: 700 + onTriggered: maxOrWindedBtn.showSplitMenu() + } + Timer { + id: holdTimer + interval: 300 + onTriggered: maxOrWindedBtn.__longPressed = maxOrWindedBtn.showSplitMenu() + } + Connections { + target: control + function onSplitScreenEnabledChanged() { + if (!control.splitScreenEnabled) + maxOrWindedBtn.hideSplitMenu(false) + } + } visible: (hasWindowFlag && !__forceHind && __canResize && __sizeResizable) enabled: (__canMaximize && __canResize) diff --git a/src/dquickwindow.cpp b/src/dquickwindow.cpp index 4988bc1dd..8b5b863bc 100644 --- a/src/dquickwindow.cpp +++ b/src/dquickwindow.cpp @@ -15,6 +15,8 @@ #include #include +#include +#include DQUICK_BEGIN_NAMESPACE @@ -1010,6 +1012,45 @@ void DQuickWindowAttached::popupSystemWindowMenu() DWindowManagerHelper::popupSystemWindowMenu(window()); } +// Platform split-menu functions take a Qt window id and a global logical rectangle. +bool DQuickWindowAttached::showSplitMenu(QQuickItem *button) +{ + D_D(DQuickWindowAttached); + auto *w = window(); + if (!w || !w->isVisible() || !w->handle() || !button || button->window() != w + || !button->isVisible() || !button->isEnabled()) + return false; + + const auto support = reinterpret_cast( + QGuiApplication::platformFunction("_d_supportSplitMenu")); + const auto show = reinterpret_cast( + QGuiApplication::platformFunction("_d_showSplitMenu")); + const auto hide = QGuiApplication::platformFunction("_d_hideSplitMenu"); + const WId wid = w->winId(); + if (!support || !show || !hide || !support(wid)) + return false; + + const QRect rect = button->mapRectToScene(button->boundingRect()).toAlignedRect(); + if (!rect.isValid()) + return false; + show(wid, QRect(w->mapToGlobal(rect.topLeft()), rect.size())); + d->splitMenuWindowId = wid; + return true; +} + +void DQuickWindowAttached::hideSplitMenu(bool delay) +{ + D_D(DQuickWindowAttached); + if (!d->splitMenuWindowId) + return; + const auto hide = reinterpret_cast( + QGuiApplication::platformFunction("_d_hideSplitMenu")); + if (hide) + hide(d->splitMenuWindowId, delay); + if (!delay) + d->splitMenuWindowId = 0; +} + bool DQuickWindowAttached::setWindowBlurAreaByWM(const QVector &area) { D_D(DQuickWindowAttached); diff --git a/src/dquickwindow.h b/src/dquickwindow.h index db67525b4..bf74fad1f 100644 --- a/src/dquickwindow.h +++ b/src/dquickwindow.h @@ -148,6 +148,9 @@ public Q_SLOTS: void popupSystemWindowMenu(); + bool showSplitMenu(QQuickItem *button); + void hideSplitMenu(bool delay = true); + bool setWindowBlurAreaByWM(const QVector &area); bool setWindowBlurAreaByWM(const QList &area); diff --git a/src/private/dquickwindow_p.h b/src/private/dquickwindow_p.h index 801279e78..07efd715e 100644 --- a/src/private/dquickwindow_p.h +++ b/src/private/dquickwindow_p.h @@ -56,6 +56,7 @@ class DQuickWindowAttachedPrivate : public DTK_CORE_NAMESPACE::DObjectPrivate #endif QPointer window = nullptr; + WId splitMenuWindowId = 0; DPlatformHandle *handle = nullptr; BoolOptional explicitEnable {Invalid}; BoolOptional explicitTranslucentBackground {Invalid}; From 5b35715230a2c3b31efbb9980d1d643db8bffa66 Mon Sep 17 00:00:00 2001 From: 52cyb Date: Tue, 8 Sep 2026 13:09:07 +0800 Subject: [PATCH 15/31] fix: use formal parameter in ThemeMenu signal handler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Change onTriggered to function(action) syntax in qt6/src/qml/ThemeMenu.qml 2. Fix Qt6 deprecation warning about implicit signal parameter injection 3. Keep consistent with other signal handlers in the repository 4. Update SPDX copyright year to 2026 Influence: 1. Test theme switching (Light/Dark/System) in dde-control-center 2. Verify no deprecation warning in console output 3. Confirm Qt5 build is unaffected by the change fix: 修复 ThemeMenu 信号处理器参数注入弃用警告 1. 修改 qt6/src/qml/ThemeMenu.qml 中 onTriggered 为 function(action) 语法 2. 修复 Qt6 关于信号参数隐式注入的弃用警告 3. 与仓库中其他信号处理器保持风格一致 4. 更新 SPDX 版权年份至 2026 Influence: 1. 在控制中心测试主题切换(浅色/深色/跟随系统) 2. 验证控制台不再输出弃用警告 3. 确认 Qt5 构建不受此改动影响 PMS: TASK-392413 --- qt6/src/qml/ThemeMenu.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qt6/src/qml/ThemeMenu.qml b/qt6/src/qml/ThemeMenu.qml index 3197bf069..4a2cfe62a 100644 --- a/qt6/src/qml/ThemeMenu.qml +++ b/qt6/src/qml/ThemeMenu.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2021 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -14,7 +14,7 @@ Menu { ActionGroup { id: themeEG exclusive: true - onTriggered: { + onTriggered: function(action) { D.ApplicationHelper.setPaletteType(action.themeType) } } From c82227ab413616a0ecdfcb773e7fc41db839996b Mon Sep 17 00:00:00 2001 From: "deepin-bot[bot]" <100105596+deepin-bot[bot]@users.noreply.github.com> Date: Tue, 22 Sep 2026 17:15:31 +0800 Subject: [PATCH 16/31] chore: New release 6.7.50 (#709) Log: Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 17 +++++++++++++++++ VERSION | 2 +- archlinux/PKGBUILD | 2 +- debian/changelog | 6 ++++++ 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd1e7b180..87be833fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.7.50] - 2026-09-22 + +### Added + +- Add split screen menu to title bar + +### Changed + +- I18n: Translate dtkdeclarative.ts in sv (#674) + +### Fixed + +- Set fixed default implicit size for Window popupType +- Restore implicit size bindings on Popup for qt6 +- Correct model reference in ArrowListView +- Use formal parameter in ThemeMenu signal handler + ## [6.7.49] - 2026-09-10 ### Added diff --git a/VERSION b/VERSION index c9952ecc6..72054a98c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.7.49 +6.7.50 diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index a1a4c87ef..6aa36dea4 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: zccrs pkgname=dtkdeclarative-git -pkgver=6.7.49 +pkgver=6.7.50 pkgrel=1 sourcename=dtkdeclarative sourcetars=("$sourcename"_"$pkgver".tar.xz) diff --git a/debian/changelog b/debian/changelog index b4b9646b6..482f18141 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dtkdeclarative (6.7.50) unstable; urgency=medium + + * Release 6.7.50 + + -- yeshanshan Tue, 22 Sep 2026 16:19:42 +0800 + dtkdeclarative (6.7.49) unstable; urgency=medium * Release 6.7.49 From 4769ee4dd4d92f17015bebda85129fbb73035632 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Mon, 28 Sep 2026 18:33:23 +0800 Subject: [PATCH 17/31] fix(ComboBox): size popup before it is mapped MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Size the window popup from the model and the measured delegate height, instead of the content item, which has not been laid out yet when the window is created. 2. Measure the delegate height in ArrowListView by realizing one item while the popup is still closed, and pin the scroll-arrow height so the layout settles in one pass. 3. Keep the style item height only as the viewport that makes that first measurement possible. Log: ComboBox popups appear at their final size instead of being resized after being mapped. Influence: Removes the popup size jump with Window popup type. fix(ComboBox): 弹窗按最终尺寸显示 1. 窗口弹窗改用模型与实测行高计算尺寸,不再使用尚未布局的内容项。 2. ArrowListView 在弹窗关闭时提前实例化一项以量出行高,并固定箭头条高度,使布局一次到位。 3. 样式行高仅作为首次测量所需的引导视口。 Log: 下拉弹窗显示时即为其最终尺寸,不再在显示后改变尺寸。 PMS: BUG-370839 Influence: 修复 Window 类型弹窗的尺寸跳动。 --- qt6/src/qml/ArrowListView.qml | 16 ++++++++++++++-- qt6/src/qml/ComboBox.qml | 3 +++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/qt6/src/qml/ArrowListView.qml b/qt6/src/qml/ArrowListView.qml index f6b2eace5..eb7c880c2 100644 --- a/qt6/src/qml/ArrowListView.qml +++ b/qt6/src/qml/ArrowListView.qml @@ -15,6 +15,17 @@ FocusScope { property int itemHeight: DS.Style.arrowListView.itemHeight property alias view: itemsView + // Full height of the list, to size a popup before it is mapped. + readonly property real sizedHeight: { + if (itemsView.count === 0) + return 0 + const item = itemsView.itemAtIndex(0) + const measured = itemsView.contentHeight > 0 && item ? (item.height || item.implicitHeight) : 0 + const arrowStrips = itemsView.count > maxVisibleItems + ? 2 * (DS.Style.arrowListView.stepButtonIconSize.height + contentLayout.spacing) : 0 + return Math.min(itemsView.count, maxVisibleItems) * (measured > 0 ? measured : itemHeight) + arrowStrips + } + implicitWidth: Math.max(DS.Style.arrowListView.width, contentLayout.implicitWidth) implicitHeight: contentLayout.implicitHeight @@ -25,7 +36,7 @@ FocusScope { visible: itemsView.interactive Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - Layout.preferredHeight: implicitHeight + Layout.preferredHeight: DS.Style.arrowListView.stepButtonIconSize.height view: itemsView stepSize: control.itemHeight direction: P.ArrowListViewButton.UpButton @@ -36,6 +47,7 @@ FocusScope { clip: true Layout.fillWidth: true Layout.fillHeight: true + onHeightChanged: if (height > 0 && contentHeight === 0) forceLayout() implicitHeight: itemsView.count > 0 ? Math.min(contentHeight, maxVisibleItems * contentHeight / itemsView.count) : 0 implicitWidth:{ var maxWidth = DS.Style.arrowListView.width @@ -81,7 +93,7 @@ FocusScope { visible: itemsView.interactive Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true - Layout.preferredHeight: implicitHeight + Layout.preferredHeight: DS.Style.arrowListView.stepButtonIconSize.height view: itemsView stepSize: control.itemHeight direction: P.ArrowListViewButton.DownButton diff --git a/qt6/src/qml/ComboBox.qml b/qt6/src/qml/ComboBox.qml index cb35c3c38..9f3d53416 100644 --- a/qt6/src/qml/ComboBox.qml +++ b/qt6/src/qml/ComboBox.qml @@ -173,6 +173,9 @@ T.ComboBox { rightMargin: DS.Style.popup.margin palette: control.palette implicitWidth: control.flat ? Math.max(contentItem.implicitWidth, control.width) : control.width + // 60 is a temporary viewport so the list can realize one row and be measured. + implicitHeight: (contentItem.sizedHeight > 0 ? contentItem.sizedHeight : 2 * DS.Style.arrowListView.itemHeight) + + topPadding + bottomPadding onClosed: control.isInteractingWithContent = false Connections { target: control From 4d55a74907064a84b3df8b3efef69c19547b35d5 Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Thu, 15 Oct 2026 14:04:15 +0800 Subject: [PATCH 18/31] i18n: Translate dtkdeclarative.ts in mn (#720) 100% translated source file: 'dtkdeclarative.ts' on 'mn'. Multica: DDE-437 Log: --- src/translations/dtkdeclarative_mn.ts | 131 ++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 src/translations/dtkdeclarative_mn.ts diff --git a/src/translations/dtkdeclarative_mn.ts b/src/translations/dtkdeclarative_mn.ts new file mode 100644 index 000000000..de18cf8cb --- /dev/null +++ b/src/translations/dtkdeclarative_mn.ts @@ -0,0 +1,131 @@ + + + AboutAction + + + About + Тухай + + + + AboutDialog + + + Version + Хувилбар + + + + Homepage + Нүүр хуудас + + + + Description + Тайлбар + + + + Acknowledgements + Талархал + + + + Sincerely appreciate the %1 used. + Ашигласан %1-д үнэхээр талархаж байна. + + + + open-source software + нээлттэй эхийн програм хангамж + + + + HelpAction + + + Help + Тусламж + + + + LicenseDialog + + + open-source software + нээлттэй эхийн програм хангамж + + + + QuitAction + + + Exit + Гарах + + + + SearchEdit + + + Search + Хайх + + + + TextField + + + Copy + Хуулах + + + + Cut + Таслах + + + + Paste + Буулгах + + + + Select All + Бүгдийг сонгох + + + + Undo + Буцаах + + + + Redo + Дахин хийх + + + + ThemeMenu + + + Theme + Загвар + + + + Light Theme + Цайвар загвар + + + + Dark Theme + Бараан загвар + + + + System Theme + Системийн загвар + + + \ No newline at end of file From 4325119290e4b8244e6c152367619129bdaae7b0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 15 Oct 2026 20:23:34 +0800 Subject: [PATCH 19/31] chore: New release 6.7.51 Log: --- CHANGELOG.md | 10 ++++++++++ VERSION | 2 +- archlinux/PKGBUILD | 2 +- debian/changelog | 6 ++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87be833fb..4c2361af0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.7.51] - 2026-10-15 + +### Changed + +- I18n: Translate dtkdeclarative.ts in mn (#720) + +### Fixed + +- Size popup before it is mapped + ## [6.7.50] - 2026-09-22 ### Added diff --git a/VERSION b/VERSION index 72054a98c..2b097dadd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.7.50 +6.7.51 diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index 6aa36dea4..80299cf5f 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: zccrs pkgname=dtkdeclarative-git -pkgver=6.7.50 +pkgver=6.7.51 pkgrel=1 sourcename=dtkdeclarative sourcetars=("$sourcename"_"$pkgver".tar.xz) diff --git a/debian/changelog b/debian/changelog index 482f18141..f9fc34cab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dtkdeclarative (6.7.51) unstable; urgency=medium + + * Release 6.7.51 + + -- yeshanshan Thu, 15 Oct 2026 20:23:34 +0800 + dtkdeclarative (6.7.50) unstable; urgency=medium * Release 6.7.50 From 3d00a9daf9ff69f28dc3102c80ae126bc21b2453 Mon Sep 17 00:00:00 2001 From: Wu JiangYu Date: Tue, 29 Sep 2026 16:53:58 +0800 Subject: [PATCH 20/31] feat: add window blur control to DialogWindow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Add enableBehindWindowBlur property to DialogWindow with default true 2. Bind StyledBehindWindowBlur visibility to this new property 3. Disable behind window blur in SettingsDialog for better performance 4. Set SettingsDialog background to palette.base instead of transparent 5. Add rounded corner styling to SettingsDialog content background 6. Enable clipping on navigation and content ListViews to prevent overflow 7. Restructure content padding using individual padding properties Log: Added blur control option for dialog windows and improved settings dialog appearance Influence: 1. Test dialog windows with blur enabled/disabled to verify visual effects 2. Verify SettingsDialog displays correctly without blur effect 3. Check rounded corner appearance on settings content background 4. Test navigation list scrolling with clip enabled 5. Verify content list scrolling behavior with clip property 6. Test dialog window on different platforms for blur compatibility 7. Verify padding changes don't break layout on various screen sizes feat: 为 DialogWindow 添加窗口模糊控制 1. 为 DialogWindow 添加 enableBehindWindowBlur 属性,默认值为 true 2. 将 StyledBehindWindowBlur 的可见性绑定到新属性 3. 在 SettingsDialog 中禁用窗口后模糊以提升性能 4. 将 SettingsDialog 背景设置为 palette.base 而非透明 5. 为 SettingsDialog 内容背景添加圆角样式 6. 启用导航和内容 ListView 的裁剪以防止溢出 7. 使用独立的内边距属性重构内容布局 Log: 新增对话框窗口模糊控制选项并改进设置对话框外观 Influence: 1. 测试启用/禁用模糊效果的对话框窗口,验证视觉效果 2. 验证 SettingsDialog 在无模糊效果下的显示是否正确 3. 检查设置内容背景的圆角外观 4. 测试启用裁剪后的导航列表滚动 5. 验证内容列表在裁剪属性下的滚动行为 6. 在不同平台上测试对话框窗口的模糊兼容性 7. 验证内边距更改不会在各种屏幕尺寸下破坏布局 PMS: BUG-378325 --- qt6/src/qml/DialogWindow.qml | 38 +++++--- qt6/src/qml/settings/SettingsDialog.qml | 110 ++++++++++++++---------- 2 files changed, 88 insertions(+), 60 deletions(-) diff --git a/qt6/src/qml/DialogWindow.qml b/qt6/src/qml/DialogWindow.qml index 5e5b899e8..1fd76af3b 100644 --- a/qt6/src/qml/DialogWindow.qml +++ b/qt6/src/qml/DialogWindow.qml @@ -21,9 +21,10 @@ Window { D.DWindow.wmWindowTypes: D.WindowManagerHelper.DialogType flags: Qt.Dialog | Qt.WindowCloseButtonHint | Qt.MSWindowsFixedSizeDialogHint D.ColorSelector.family: D.Palette.CrystalColor - color: "transparent" - height: content.height - width: content.width + property bool enableBehindWindowBlur: true + color: enableBehindWindowBlur ? "transparent" : palette.base + height: content.implicitHeight + width: content.implicitWidth property alias header: titleBar.sourceComponent property string icon @@ -33,31 +34,40 @@ Window { property real rightPadding: DS.Style.dialogWindow.contentHMargin property real topPadding: title === "" ? 0 : DS.Style.dialogWindow.contentVMargin - D.StyledBehindWindowBlur { - control: control + Loader { anchors.fill: parent - blendColor: { - if (valid) { + active: control.enableBehindWindowBlur + sourceComponent: D.StyledBehindWindowBlur { + control: Window.window + anchors.fill: parent + blendColor: { + if (valid) { + return DS.Style.control.selectColor(undefined, + Qt.rgba(235 / 255.0, 235 / 255.0, 235 / 255.0, 0.6), + Qt.rgba(10 / 255.0, 10 / 255.0, 10 / 255.0, 85 / 255.0)) + } return DS.Style.control.selectColor(undefined, - Qt.rgba(235 / 255.0, 235 / 255.0, 235 / 255.0, 0.6), - Qt.rgba(10 / 255.0, 10 / 255.0, 10 / 255.0, 85 / 255.0)) + DS.Style.behindWindowBlur.lightNoBlurColor, + DS.Style.behindWindowBlur.darkNoBlurColor) } - return DS.Style.control.selectColor(undefined, - DS.Style.behindWindowBlur.lightNoBlurColor, - DS.Style.behindWindowBlur.darkNoBlurColor) } } Item { id: content + anchors.fill: parent + implicitWidth: layout.implicitWidth + implicitHeight: layout.implicitHeight palette: control.active ? D.DTK.palette : D.DTK.inactivePalette - implicitHeight: childrenRect.height ColumnLayout { id: layout + anchors.fill: parent spacing: 0 Loader { id: titleBar + Layout.fillWidth: true + Layout.preferredWidth: item ? item.implicitWidth : 0 z: D.DTK.TopOrder sourceComponent: DialogTitleBar { enableInWindowBlendBlur: false @@ -67,6 +77,7 @@ Window { Loader { active: title !== "" + visible: active Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter sourceComponent: Component { @@ -82,6 +93,7 @@ Window { Item { id: contentLoader Layout.fillWidth: true + Layout.fillHeight: true Layout.preferredHeight: childrenRect.height Layout.leftMargin: control.leftPadding Layout.rightMargin: control.rightPadding diff --git a/qt6/src/qml/settings/SettingsDialog.qml b/qt6/src/qml/settings/SettingsDialog.qml index e11726df0..d54dab909 100644 --- a/qt6/src/qml/settings/SettingsDialog.qml +++ b/qt6/src/qml/settings/SettingsDialog.qml @@ -3,6 +3,7 @@ // SPDX-License-Identifier: LGPL-3.0-or-later import QtQuick +import QtQuick.Layouts import org.deepin.dtk 1.0 as D import org.deepin.dtk.style 1.0 as DS import org.deepin.dtk.settings 1.0 as Settings @@ -10,6 +11,7 @@ import org.deepin.dtk 1.0 DialogWindow { id: control + enableBehindWindowBlur: false property list groups property QtObject config @@ -28,60 +30,74 @@ DialogWindow { property alias navigationView: navigationView property alias contentView: contentView - ScrollView { - id: navigationBg - clip: true - width: DS.Style.settings.navigation.width - background: Rectangle { - anchors.fill: parent - color: palette.base - } + RowLayout { + anchors.fill: parent + spacing: 0 - ListView { - id: navigationView - model: container.navigationModel - leftMargin: DS.Style.settings.navigation.margin - rightMargin: DS.Style.settings.navigation.margin - currentIndex: 0 - onCurrentIndexChanged: { - contentView.currentIndex = currentIndex - } - } - } + ScrollView { + id: navigationBg + clip: true + Layout.preferredWidth: DS.Style.settings.navigation.width + Layout.fillHeight: true - ScrollView { - id: contentBg - clip: true - anchors { - right: parent.right - left: navigationBg.right - top: control.top - } - padding: DS.Style.settings.content.margin - background: Rectangle { - anchors.fill: parent - color: palette.base + ListView { + id: navigationView + clip: true + model: container.navigationModel + leftMargin: DS.Style.settings.navigation.margin + rightMargin: DS.Style.settings.navigation.margin + currentIndex: 0 + onCurrentIndexChanged: { + contentView.currentIndex = currentIndex + } + } } - ListView { - id: contentView - model: container.contentModel - highlightRangeMode: ListView.StrictlyEnforceRange - currentIndex: 0 - onCurrentIndexChanged: { - navigationView.currentIndex = currentIndex + ScrollView { + id: contentBg + Layout.fillWidth: true + Layout.fillHeight: true + leftPadding: DS.Style.settings.content.margin + rightPadding: DS.Style.settings.content.margin + topPadding: DS.Style.settings.content.margin + bottomPadding: DS.Style.settings.content.margin + background: Rectangle { + anchors.fill: parent + color: palette.window + radius: DS.Style.control.radius + Rectangle { + anchors { + fill: parent + leftMargin: contentBg.leftPadding + rightMargin: contentBg.rightPadding + topMargin: contentBg.topPadding + bottomMargin: contentBg.bottomPadding + } + color: palette.base + } } - footer: Item { - width: parent.width - height: DS.Style.settings.content.resetButtonHeight - Button { - anchors.horizontalCenter: parent.horizontalCenter - anchors.bottom: parent.bottom - text: qsTr("Restore Defaults") + ListView { + id: contentView + model: container.contentModel + clip: true + highlightRangeMode: ListView.StrictlyEnforceRange + currentIndex: 0 + onCurrentIndexChanged: { + navigationView.currentIndex = currentIndex + } + footer: Item { + width: parent.width + height: DS.Style.settings.content.resetButtonHeight + + Button { + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: parent.bottom + text: qsTr("Restore Defaults") - onClicked: { - settingsContainer.resetSettings(); + onClicked: { + settingsContainer.resetSettings(); + } } } } From ccb129a6f37eb2893ec5ba2af09a26645615d08b Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Tue, 20 Oct 2026 21:40:52 +0800 Subject: [PATCH 21/31] fix: prevent palette feedback binding loops MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Store palette changed connection and disconnect it when control changes to avoid stale connections 2. Add null check for palette pointer before connecting to changed signal 3. Defer updateControlTheme via scheduleControlThemeUpdate using queued connection to break binding feedback loops 4. Add m_controlThemeUpdatePending flag to coalesce multiple update requests 5. Add unit tests for deferred/coalesced palette updates, destruction with pending updates, and styled control palette feedback The palette is both an input and output of the color selector, causing binding loops when palette changes triggered immediate writes back to the same palette. Deferring the update to the next event loop iteration allows existing bindings to finish before notifying again. The connection cleanup prevents dangling connections when the control's palette changes. Influence: 1. Test controls with palette bindings to D.ColorSelector (Button, ToolButton, MenuItem) 2. Verify no "Binding loop" warnings appear in console 3. Test theme switching between light and dark modes 4. Test hover, press, checked, disabled states with palette feedback 5. Verify selector destruction while a palette update is pending does not crash 6. Confirm palette updates settle and do not trigger continuous event processing fix: 修复调色板反馈导致的绑定循环 1. 保存调色板 changed 信号连接,在控件切换时断开以避免遗留连接 2. 连接 changed 信号前增加调色板空指针检查 3. 通过 scheduleControlThemeUpdate 使用队列连接延迟 updateControlTheme 以打破绑定反馈循环 4. 添加 m_controlThemeUpdatePending 标志合并多次更新请求 5. 添加延迟/合并调色板更新、销毁时存在待处理更新、以及带样式控件调色板反 馈的单元测试 调色板既是颜色选择器的输入也是输出,当调色板变化立即回写同一调色板时会触 发绑定循环。将更新延迟到下一个事件循环迭代,使已有绑定先完成再通知。连接 清理可避免控件调色板变化时产生悬空连接。 Influence: 1. 测试使用 D.ColorSelector 调色板绑定的控件(Button、ToolButton、 MenuItem) 2. 验证控制台不出现"Binding loop"警告 3. 测试明暗主题切换 4. 测试 hover、按下、选中、禁用状态下的调色板反馈 5. 验证存在待处理调色板更新时销毁选择器不会崩溃 6. 确认调色板更新能稳定下来,不会触发持续的事件处理 --- src/private/dquickcontrolpalette.cpp | 22 ++++- src/private/dquickcontrolpalette_p.h | 3 + tests/ut_colorselector.cpp | 138 ++++++++++++++++++++++++++- 3 files changed, 158 insertions(+), 5 deletions(-) diff --git a/src/private/dquickcontrolpalette.cpp b/src/private/dquickcontrolpalette.cpp index a8ea3dcc0..50c42b5be 100644 --- a/src/private/dquickcontrolpalette.cpp +++ b/src/private/dquickcontrolpalette.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) #include #endif @@ -458,6 +459,7 @@ void DQuickControlColorSelector::setControl(QQuickItem *newControl) return; // Clean for old + disconnect(m_controlPaletteConnection); if (m_control) { m_control->disconnect(this); if (auto w = m_control->window()) @@ -469,14 +471,16 @@ void DQuickControlColorSelector::setControl(QQuickItem *newControl) if (m_control) { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) auto palette = m_control->property("palette").value(); - connect(palette, &QQuickPalette::changed, this, &DQuickControlColorSelector::updateControlTheme); + if (palette) + m_controlPaletteConnection = connect(palette, &QQuickPalette::changed, + this, &DQuickControlColorSelector::scheduleControlThemeUpdate); #endif connect(m_control, &QObject::destroyed, this, [this] { m_controlWindow = nullptr; m_control = nullptr; }); if (m_control->metaObject()->indexOfSignal("paletteChanged()") != -1) { - connect(m_control, SIGNAL(paletteChanged()), this, SLOT(updateControlTheme())); + connect(m_control, SIGNAL(paletteChanged()), this, SLOT(scheduleControlThemeUpdate())); } if (m_control->metaObject()->indexOfSignal("hoveredChanged()") != -1) { connect(m_control, SIGNAL(hoveredChanged()), this, SLOT(updateControlState())); @@ -1010,6 +1014,20 @@ void DQuickControlColorSelector::updateFamilyForChildrenRecu(QQuickItem *parent) } } +void DQuickControlColorSelector::scheduleControlThemeUpdate() +{ + if (m_controlThemeUpdatePending) + return; + + m_controlThemeUpdatePending = true; + // Palette changes can originate from a binding to one of our colors. + // Wait until that binding has finished before notifying it again. + QMetaObject::invokeMethod(this, [this] { + m_controlThemeUpdatePending = false; + updateControlTheme(); + }, Qt::QueuedConnection); +} + void DQuickControlColorSelector::updateControlTheme() { if (!m_control) diff --git a/src/private/dquickcontrolpalette_p.h b/src/private/dquickcontrolpalette_p.h index fb1631989..49bf8d8af 100644 --- a/src/private/dquickcontrolpalette_p.h +++ b/src/private/dquickcontrolpalette_p.h @@ -352,6 +352,7 @@ class DQuickControlColorSelector : public QObject QByteArray findPalettePropertyName(const DQuickControlPalette *palette) const; void clearAndInheritParentProperties(); + Q_SLOT void scheduleControlThemeUpdate(); Q_SLOT void updateControlTheme(); Q_SLOT bool updateControlState(); Q_SLOT void updateAllColorProperties(); @@ -371,6 +372,8 @@ class DQuickControlColorSelector : public QObject void setFamilyPropertyParent(DQuickControlColorSelector *parent); QPointer m_control; + QMetaObject::Connection m_controlPaletteConnection; + bool m_controlThemeUpdatePending = false; QPointer m_controlWindow; QPointer m_superColorSelector; QPointer m_parentOfFamilyProperty; diff --git a/tests/ut_colorselector.cpp b/tests/ut_colorselector.cpp index 3a7547ebe..ce749ccd4 100644 --- a/tests/ut_colorselector.cpp +++ b/tests/ut_colorselector.cpp @@ -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 @@ -8,6 +8,13 @@ #include #include #include +#include +#include +#include + +#include "dquickcontrolpalette_p.h" + +DQUICK_USE_NAMESPACE class ut_ColorSelector : public ::testing::Test { @@ -27,6 +34,10 @@ void ut_ColorSelector::TearDown() TEST_F(ut_ColorSelector, getColorFromProperty) { ControlHelper helper("qrc:/qml/ColorSelector_GetColorFromProperty.qml"); + const auto cleanup = qScopeGuard([&helper] { + delete helper.object; + helper.object = nullptr; + }); ASSERT_TRUE(helper.object); auto listView = helper.object->property("view").value(); @@ -41,7 +52,128 @@ TEST_F(ut_ColorSelector, getColorFromProperty) QQmlEngine &engine = helper.engine; engine.globalObject().setProperty("background", engine.newQObject(background)); - ThemeTypeGuard themeGurad(DGuiApplicationHelper::LightType); - Q_UNUSED(themeGurad); + ASSERT_TRUE(QQmlProperty::write(helper.object, "palette.window", QColor(Qt::white))); + QTest::qWaitFor([&] { + return background->property("color") + == engine.evaluate("background.color1.normal.common.color()").toVariant(); + }); ASSERT_EQ(background->property("color"), engine.evaluate("background.color1.normal.common.color()").toVariant()); } + +// Use a template control to exercise palette feedback without unrelated style +// assets. The palette is both an input and an output of the color selector. +static const char paletteFeedbackQml[] = +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + "import QtQuick\nimport QtQuick.Templates as T\n" +#else + "import QtQuick 2.11\nimport QtQuick.Templates 2.4 as T\n" +#endif +R"( +import org.deepin.dtk 1.0 as D + +T.Button { + property D.Palette textColor: D.Palette { + normal: ("red") + normalDark: ("blue") + } + palette.window: "white" + palette.windowText: D.ColorSelector.textColor +} +)"; + +TEST_F(ut_ColorSelector, paletteUpdatesAreDeferredAndCoalesced) +{ + QList warnings; + ControlHelper helper; + QObject::connect(&helper.engine, &QQmlEngine::warnings, &helper.engine, + [&warnings](const QList &errors) { warnings.append(errors); }); + ASSERT_TRUE(helper.setData(paletteFeedbackQml)); + const auto cleanup = qScopeGuard([&helper] { + delete helper.object; + helper.object = nullptr; + }); + auto selector = qobject_cast( + qmlAttachedPropertiesObject(helper.object)); + ASSERT_NE(selector, nullptr); + QCoreApplication::processEvents(); + QSignalSpy themeChanges(selector, &DQuickControlColorSelector::controlThemeChanged); + QSignalSpy colorChanges(selector, &DQuickControlColorSelector::colorPropertyChanged); + + ASSERT_TRUE(QQmlProperty::write(helper.object, "palette.window", QColor(Qt::black))); + ASSERT_TRUE(QQmlProperty::write(helper.object, "palette.window", QColor(Qt::white))); + EXPECT_EQ(themeChanges.count(), 0); + QCoreApplication::processEvents(); + EXPECT_EQ(themeChanges.count(), 0); + EXPECT_EQ(colorChanges.count(), 0); + + ASSERT_TRUE(QQmlProperty::write(helper.object, "palette.window", QColor(Qt::black))); + EXPECT_EQ(themeChanges.count(), 0); + QCoreApplication::processEvents(); + EXPECT_EQ(themeChanges.count(), 1); + EXPECT_EQ(QQmlProperty::read(helper.object, "palette.windowText").value(), QColor(Qt::blue)); + + // The palette writeback must settle rather than continuously queue updates. + const int settledChanges = colorChanges.count(); + for (int i = 0; i < 5; ++i) + QCoreApplication::processEvents(); + EXPECT_EQ(colorChanges.count(), settledChanges); + EXPECT_FALSE(selector->m_controlThemeUpdatePending); + for (const auto &warning : warnings) + EXPECT_FALSE(warning.description().contains("Binding loop")) << warning.toString().toStdString(); +} + +TEST_F(ut_ColorSelector, destroyWithPendingPaletteUpdate) +{ + ControlHelper helper; + ASSERT_TRUE(helper.setData(paletteFeedbackQml)); + QPointer selector = qmlAttachedPropertiesObject(helper.object); + ASSERT_TRUE(QQmlProperty::write(helper.object, "palette.window", QColor(Qt::black))); + delete helper.object; + helper.object = nullptr; + EXPECT_TRUE(selector.isNull()); + QCoreApplication::processEvents(); +} + +TEST_F(ut_ColorSelector, styledControlsPaletteFeedback) +{ + for (const QByteArray &type : {QByteArray("Button"), QByteArray("ToolButton"), QByteArray("MenuItem")}) { + SCOPED_TRACE(type.constData()); + QList warnings; + ControlHelper helper; + QObject::connect(&helper.engine, &QQmlEngine::warnings, &helper.engine, + [&warnings](const QList &errors) { warnings.append(errors); }); + ASSERT_TRUE(helper.setData("import QtQuick 2.11\nimport org.deepin.dtk 1.0 as D\nD." + + type + " { text: \"Palette feedback\" }")); + const auto cleanup = qScopeGuard([&helper] { + delete helper.object; + helper.object = nullptr; + }); + auto selector = qobject_cast( + qmlAttachedPropertiesObject(helper.object)); + ASSERT_NE(selector, nullptr); + QSignalSpy changes(selector, &DQuickControlColorSelector::colorPropertyChanged); + for (bool dark : {false, true}) { + ASSERT_TRUE(QQmlProperty::write(helper.object, "palette.window", + QColor(dark ? Qt::black : Qt::white))); + for (bool inactive : {true, false}) { + selector->setInactived(inactive); + for (int state = 0; state < 5; ++state) { + selector->setHovered(state == 1); + selector->setPressed(state == 2); + helper.object->setEnabled(state != 3); + helper.object->setProperty("checked", state == 4); + for (int i = 0; i < 5; ++i) + QCoreApplication::processEvents(); + EXPECT_EQ(QQmlProperty::read(helper.object, "palette.windowText").value(), + selector->property("textColor").value()); + const int settledChanges = changes.count(); + QCoreApplication::processEvents(); + EXPECT_EQ(changes.count(), settledChanges); + EXPECT_FALSE(selector->m_controlThemeUpdatePending); + } + } + } + for (const auto &warning : warnings) + EXPECT_FALSE(warning.description().contains("Binding loop")) << warning.toString().toStdString(); + } +} From d02f5c98fcff127aa422531cc85f2c52d16e7ad9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 Oct 2026 16:31:26 +0800 Subject: [PATCH 22/31] chore: New release 6.7.52 Log: --- CHANGELOG.md | 10 ++++++++++ VERSION | 2 +- archlinux/PKGBUILD | 2 +- debian/changelog | 6 ++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c2361af0..d5a91b9cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.7.52] - 2026-10-28 + +### Added + +- Add window blur control to DialogWindow + +### Fixed + +- Prevent palette feedback binding loops + ## [6.7.51] - 2026-10-15 ### Changed diff --git a/VERSION b/VERSION index 2b097dadd..95f41b0c7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.7.51 +6.7.52 diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index 80299cf5f..ee2801f24 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: zccrs pkgname=dtkdeclarative-git -pkgver=6.7.51 +pkgver=6.7.52 pkgrel=1 sourcename=dtkdeclarative sourcetars=("$sourcename"_"$pkgver".tar.xz) diff --git a/debian/changelog b/debian/changelog index f9fc34cab..5ae3aec56 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dtkdeclarative (6.7.52) unstable; urgency=medium + + * Release 6.7.52 + + -- yeshanshan Wed, 28 Oct 2026 16:31:26 +0800 + dtkdeclarative (6.7.51) unstable; urgency=medium * Release 6.7.51 From 0159003c7971513e195dabede01eb93ef93b7cb0 Mon Sep 17 00:00:00 2001 From: caixiangrong Date: Thu, 29 Oct 2026 14:30:34 +0800 Subject: [PATCH 23/31] fix: delete backdrop renderer on invalidated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. RhiManager now connects to QSGRenderContext::invalidated (DirectConnection) and destroys the Renderer immediately in destroyRenderer(), rather than waiting until RhiManager's destructor runs during QObject child cleanup. 2. Renderer holds a reference to QSGRenderContext's ShaderManager child; deleting the renderer after that child is gone causes a SIGSEGV in ~Renderer -> ShaderManager::clearCachedRendererData. Handling invalidated matches Qt's QSGRhiLayer pattern. 3. sync(), preprocess(), and render() now bail out when renderer (or m_rhi in preprocess) is null, preventing operations on a destroyed RHI context. 4. context/renderer are initialized to nullptr in the constructor, and destroyRenderer() is reused from both invalidated and ~RhiManager. 5. Added regression test destroyWithBackdropNodeOnRhi, which renders a frame with DQuickBackdropBlitter then destroys the window; it crashed before this fix and exits cleanly after. Log: Fixed exit crash caused by DBackdropBlitter renderer lifecycle Influence: 1. Close windows in existing InWindowBlur demos/apps and confirm no crash on the default RHI rendering path. 2. Run related scenes with the software scene graph backend to confirm the guards preserve behavior when RhiManager is not created. 3. On Qt6, exercise window teardown with OpenGL/Vulkan/D3D/Metal RHI backends, with and without DTK_DISABLE_INWINDOWBLUR. 4. Run the new regression test ut_DQuickInWindowBlur.destroyWithBackdropNodeOnRhi and verify it passes. fix: 在 invalidated 时销毁 backdrop renderer 1. RhiManager 现在以直连连接监听 QSGRenderContext::invalidated,在信号 发出时立即通过 destroyRenderer() 销毁 Renderer,不再等到 RhiManager 析构 (QObject 子对象清理阶段)才执行。 2. Renderer 持有 QSGRenderContext 的 QObject 子对象 ShaderManager 的 引用;在 ShaderManager 销毁后才 delete Renderer,会在 ~Renderer → ShaderManager::clearCachedRendererData 中访问已释放内存并崩溃。Qt 对 QSGRhiLayer 也是同样处理。 3. sync()、preprocess()、render() 在 renderer(preprocess 中还包含 m_rhi)为空时直接返回,避免在已销毁的 RHI context 上继续渲染。 4. 构造函数将 context/renderer 初始化为 nullptr,删除逻辑集中到 destroyRenderer(),析构函数也调用它。 5. 新增回归用例 destroyWithBackdropNodeOnRhi:先通过 DQuickBackdropBlitter 渲染一帧再销毁窗口;修复前会崩溃,修复后可正常 退出。 Log: 修复 DBackdropBlitter 渲染器生命周期导致的退出崩溃 Influence: 1. 运行已有的 InWindowBlur 示例/应用并关闭窗口,确认默认 RHI 渲染路径不 崩溃。 2. 使用软件场景图后端运行相关场景,确认未创建 RhiManager 时保护逻辑不影 响原有行为。 3. 在 Qt6 下分别使用 OpenGL/Vulkan/D3D/Metal RHI 后端测试窗口销毁,并分 别设置/不设置 DTK_DISABLE_INWINDOWBLUR。 4. 运行新增回归用例 ut_DQuickInWindowBlur.destroyWithBackdropNodeOnRhi, 确认通过。 PMS: TASK-397773 --- src/private/dbackdropnode.cpp | 27 +++++++++++++++- tests/ut_dquickinwindowblur.cpp | 55 ++++++++++++++++++++++++++++++++- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/src/private/dbackdropnode.cpp b/src/private/dbackdropnode.cpp index 68c239dc0..6f0d6792d 100644 --- a/src/private/dbackdropnode.cpp +++ b/src/private/dbackdropnode.cpp @@ -334,9 +334,14 @@ class Q_DECL_HIDDEN RhiManager : public DataManager return m_rhi->gc; } + // renderer 的生命周期由 QSGRenderContext::invalidated 决定,见 destroyRenderer()。 + // 失效后 sync()/preprocess()/render() 一律空转,避免在已销毁的 context 上继续渲染。 void sync(const QSize &pixelSize, QSGRootNode *rootNode, const QMatrix4x4 &matrix = {}, QSGRenderer *base = nullptr, const QVector2D &dpr = {}, bool flipY = false) { + if (Q_UNLIKELY(!renderer)) + return; + Q_ASSERT(!renderer->rootNode()); if (base) { @@ -377,6 +382,9 @@ class Q_DECL_HIDDEN RhiManager : public DataManager } bool preprocess(QRhiRenderTarget *rt, qreal &oldDPR, QRhiCommandBuffer* &oldCB, QSurface *forceSurface = nullptr) { + if (Q_UNLIKELY(!renderer || !m_rhi)) + return false; + QRhiCommandBuffer *cb = nullptr; #ifndef QT_NO_OPENGL @@ -414,6 +422,9 @@ class Q_DECL_HIDDEN RhiManager : public DataManager } bool render(qreal oldDPR, QRhiCommandBuffer* &oldCB) { + if (Q_UNLIKELY(!renderer)) + return false; + Q_ASSERT(D_PRIVATE_BF_GET(*renderer, QSGRenderer_m_nodes_dont_preprocess_tag, k_m_is_rendering_bit)); rendererRender(renderer); D_PRIVATE_BF_SET(*renderer, QSGRenderer_m_nodes_dont_preprocess_tag, k_m_is_rendering_bit, false); @@ -441,7 +452,9 @@ class Q_DECL_HIDDEN RhiManager : public DataManager friend class DataManager; RhiManager(QQuickWindow *owner) - : DataManager(owner) { + : DataManager(owner) + , context(nullptr) + , renderer(nullptr) { Q_ASSERT(owner->findChildren(Qt::FindDirectChildrenOnly).size() == 1); auto oldGraphicsDevice = owner->graphicsDevice(); if (owner->rhi()->backend() == QRhi::OpenGLES2) { @@ -460,10 +473,22 @@ class Q_DECL_HIDDEN RhiManager : public DataManager context = QQuickWindowPrivate::get(owner)->context; renderer = context->createRenderer(QSGRendererInterface::RenderMode2DNoDepthBuffer); + + // QSGRenderContext 在析构前会 emit invalidated(),其 QObject 子对象 ShaderManager + // (Renderer 的 m_shaderManager 指向它,见 qsgbatchrenderer.cpp)随之先被销毁。 + // Renderer 必须在这一刻释放,不能等 RhiManager 作为 QQuickWindow 的 QObject 子对象 + // 被 deleteChildren() 清理时才 delete——那时 ~Renderer 会访问已释放的 ShaderManager。 + // Qt 自身对 QSGRhiLayer 的处理即此模式(qsgrhilayer.cpp:31-37)。 + connect(context, &QSGRenderContext::invalidated, this, &RhiManager::destroyRenderer, Qt::DirectConnection); } ~RhiManager() { + destroyRenderer(); + } + + void destroyRenderer() { delete renderer; + renderer = nullptr; } static bool check() { diff --git a/tests/ut_dquickinwindowblur.cpp b/tests/ut_dquickinwindowblur.cpp index 3ae124803..9dc522c4b 100644 --- a/tests/ut_dquickinwindowblur.cpp +++ b/tests/ut_dquickinwindowblur.cpp @@ -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 @@ -9,6 +9,11 @@ #include #include "dquickinwindowblur_p.h" +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +// 回归用例需要访问 BackdropBlitter(Qt6 下 InWindowBlur 的内部实现) +# include "dquickbackdropblitter_p.h" +#endif +#include DQUICK_USE_NAMESPACE TEST(ut_DQuickInWindowBlur, properties) @@ -29,3 +34,51 @@ TEST(ut_DQuickInWindowBlur, properties) // don't be blured area EXPECT_NE(img.pixelColor(QPoint(90, 90)), TestUtil::simpleImage->pixelColor(QPoint(90, 90))); } + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +// 回归:窗口销毁时 Renderer 的生命周期必须早于 QSGRenderContext(及其子对象 +// ShaderManager)的销毁。修复前 RhiManager 在 QObject 子对象清理阶段才 delete +// renderer,~Renderer 访问已释放的 ShaderManager 必然 SIGSEGV(QSGBatchRenderer +// ::destroyGraphicsResources → ShaderManager::clearCachedRendererData,见 +// dbackdropnode.cpp RhiManager::~RhiManager)。本用例在 RHI 渲染路径上先渲染一帧、 +// 再随窗口销毁触发 invalidated(),修复前进程崩溃,修复后正常退出。 +// 仅 Qt6 有效:Qt5 的 InWindowBlur 走 DQuickInWindowBlur C++ 类,不创建 +// RhiManager,本用例场景在 Qt5 不存在。 +TEST(ut_DQuickInWindowBlur, destroyWithBackdropNodeOnRhi) +{ + TEST_OFFSCREEN_SKIP(); + + // D.InWindowBlur 在 Qt6 解析为 overridable QML(内含 D.BackdropBlitter), + // 该元素在 updatePaintNode 中创建 DBackdropNode(RhiNode)并建立 RhiManager。 + // 必须确认 node 确实被创建、且启用 InWindowBlur 场景(非软件渲染、非被 + // DTK_DISABLE_INWINDOWBLUR 关闭),否则本用例什么都没测到。 + if (QQuickWindow::sceneGraphBackend() == QLatin1String("software")) + GTEST_SKIP_("RhiManager 只在 RHI 渲染路径创建,软件渲染不适用本用例"); + + QuickViewHelper<> helper("qrc:/qml/DQuickInWindowBlur.qml"); + ASSERT_TRUE(helper.object); + + // Qt6 下 D.InWindowBlur 是 overridable QML 类型(内含 D.BackdropBlitter), + // 不再是 C++ 的 DQuickInWindowBlur;直接找 BackdropBlitter 实例。 + auto blurItem = helper.object->findChild(); + if (!blurItem) + GTEST_SKIP_("Qt6 InWindowBlur 未解析到 BackdropBlitter,环境不支持"); + if (!blurItem->blitterEnabled()) + GTEST_SKIP_("InWindowBlur 被禁用(DTK_DISABLE_INWINDOWBLUR 或 DConfig)"); + + // 等真实渲染帧而非固定延时:RhiManager/Renderer 在渲染线程同步时建立, + // 以 afterRendering(每帧从渲染线程发出、跨线程投递到主线程)作为"至少 + // 完成一帧"的信号。固定 qWait 在慢机器/高负载下可能首帧未完成就销毁, + // 测试静默"假通过"(未建立 RhiManager 就销毁,什么都没测到)。 + QQuickWindow *window = helper.view.data(); + QSignalSpy renderSpy(window, &QQuickWindow::afterRendering); + window->update(); // 若首帧已错过,强制再出一帧 + if (!renderSpy.wait(3000)) + GTEST_SKIP_("3s 内未等到渲染帧,无法确认 RhiManager 已建立,跳过本用例"); + + // 销毁窗口:走 QQuickWindow::~QQuickWindow → windowDestroyed → context + // invalidate() → delete;随后 QObject::deleteChildren 才轮到 RhiManager。 + // 修复前此行即 SIGSEGV。 + helper.clear(); +} +#endif // QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) From 4ce893f7e911bdc91cced809127764e561c9b9e3 Mon Sep 17 00:00:00 2001 From: liujiangtao Date: Mon, 2 Nov 2026 14:52:42 +0800 Subject: [PATCH 24/31] fix: Preserve Qt6 text field cursor with TapHandler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Handle context-menu right clicks with TapHandler instead of MouseArea. 2. Let TextField provide its native cursor behavior. 3. Resolve the owning window through control.Window.window. Log: Show the native text cursor when hovering over Qt6 text fields Influence: 1. Verify editable Qt6 text fields show an I-beam cursor. 2. Verify read-only text fields retain native cursor behavior. 3. Verify right-click menus in windows within the screen bounds. fix: 使用 TapHandler 保留 Qt6 输入框原生光标 1. 使用 TapHandler 替换 MouseArea 处理右键菜单点击。 2. 由 TextField 自身提供原生鼠标光标行为。 3. 通过 control.Window.window 获取输入框所属窗口。 Log: 鼠标悬停 Qt6 输入框时显示原生文本光标 Influence: 1. 验证可编辑的 Qt6 输入框悬停时显示 I 型光标。 2. 验证只读输入框保持原生鼠标光标行为。 3. 验证屏幕范围内普通窗口的右键菜单正常。 PMS: BUG-380351 --- qt6/src/qml/TextField.qml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/qt6/src/qml/TextField.qml b/qt6/src/qml/TextField.qml index 319ea3352..d069c9eb3 100644 --- a/qt6/src/qml/TextField.qml +++ b/qt6/src/qml/TextField.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2020 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: LGPL-3.0-or-later @@ -58,16 +58,15 @@ T.TextField { implicitHeight: DS.Style.edit.textFieldHeight } - MouseArea { - anchors.fill: parent + TapHandler { acceptedButtons: Qt.RightButton - onClicked: function (mouse) { - var point = Qt.point(mouse.x, mouse.y) - if (Window.window && Window.window.width > Screen.desktopAvailableWidth) { + onTapped: function (eventPoint) { + var point = Qt.point(eventPoint.position.x, eventPoint.position.y) + if (control.Window.window && control.Window.window.width > Screen.desktopAvailableWidth) { point.x = control.mapFromGlobal(Screen.desktopAvailableWidth - contextMenu.width).x } - if (Window.window && Window.window.height > Screen.desktopAvailableHeight) { + if (control.Window.window && control.Window.window.height > Screen.desktopAvailableHeight) { point.y = control.mapFromGlobal(0, Screen.desktopAvailableHeight - contextMenu.height).y } contextMenu.popup(point.x, point.y) From 485c1545657415966c57b50b69b1687066928fe1 Mon Sep 17 00:00:00 2001 From: Wu JiangYu Date: Fri, 30 Oct 2026 14:43:00 +0800 Subject: [PATCH 25/31] fix: cancel pending URL loads when setting base64 icon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Add setSource(QUrl()) call when icon name starts with "data:image/" 2. This cancels any pending URL loads in the source property 3. Prevents sourceSize changes from reloading the previous icon and overwriting the base64 image set by updateBase64Image() Log: Fixed base64 icon display being overwritten by previous icon reloads Influence: 1. Test switching from a URL-based icon to a base64 data icon 2. Verify the base64 icon displays correctly after the switch 3. Test that changing sourceSize does not reload the previous icon 4. Verify base64 icons work correctly when no previous icon was set 5. Test rapid switching between URL and base64 icons 6. Confirm that pending URL loads are properly cancelled fix: 设置 base64 图标时取消待处理的 URL 加载 1. 当图标名称以 "data:image/" 开头时添加 setSource(QUrl()) 调用 2. 取消 source 属性中待处理的 URL 加载 3. 防止 sourceSize 变更时重新加载之前的图标,覆盖 updateBase64Image() 设 置的 base64 图像 Log: 修复 base64 图标被之前图标重新加载覆盖的问题 Influence: 1. 测试从 URL 图标切换到 base64 数据图标 2. 验证切换后 base64 图标正确显示 3. 测试更改 sourceSize 不会重新加载之前的图标 4. 验证未设置之前图标时 base64 图标正常工作 5. 测试在 URL 图标和 base64 图标之间快速切换 6. 确认待处理的 URL 加载被正确取消 PMS: TASK-397855 --- src/private/dquickiconimage.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/private/dquickiconimage.cpp b/src/private/dquickiconimage.cpp index e7cfb43f1..a49fc5556 100644 --- a/src/private/dquickiconimage.cpp +++ b/src/private/dquickiconimage.cpp @@ -213,6 +213,9 @@ void DQuickIconImage::setName(const QString &name) if (name.startsWith("data:image/")) { d->iconType = DQuickIconImagePrivate::Base64Data; + // Cancel pending URL loads and prevent sourceSize changes from + // reloading the previous icon over the image set by updateBase64Image(). + setSource(QUrl()); } else if (QQmlFile::isLocalFile(name)) { QUrl url(name); From 01d27359fb034fc644a8c0623fa4c85875ae71af Mon Sep 17 00:00:00 2001 From: Wu JiangYu Date: Wed, 4 Nov 2026 11:15:56 +0800 Subject: [PATCH 26/31] fix: adjust dialog layout sizing to prevent stretch issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Replace anchors.fill with explicit width/height bindings in DialogWindow.qml 2. Remove Layout.fillHeight from contentLoader to avoid forcing dialog expansion 3. Remove Layout.fillWidth and preferredWidth from titleBar loader 4. Set SettingsDialog default height to minimumHeight to prevent circular dependency on content size 5. Bind RowLayout height to available space below title bar instead of filling parent The previous anchoring caused the dialog window to stretch unexpectedly because content heights fed back into the window size calculation. By decoupling the layout from parent fill anchors and setting a fixed default height, the dialog now respects its minimum height and sizes content correctly. Influence: 1. Open settings dialog and verify it opens at minimum height without stretching 2. Resize the dialog window and confirm content adapts properly 3. Verify the title bar renders correctly without the fill width layout properties 4. Test content scrolling within the dialog when content exceeds window height 5. Check that dialogs in different DPI scales render correctly 6. Verify no visual regressions in dialog content margins and padding fix: 调整对话框布局尺寸以防止拉伸问题 1. 在 DialogWindow.qml 中用显式宽高绑定替换 anchors.fill 2. 移除 contentLoader 的 Layout.fillHeight 以避免强制对话框扩展 3. 移除 titleBar loader 的 Layout.fillWidth 和 preferredWidth 4. 将 SettingsDialog 默认高度设为 minimumHeight 以避免对内容尺寸的循环 依赖 5. 将 RowLayout 高度绑定到标题栏下方可用空间而非填充父级 之前的锚定方式导致对话框窗口意外拉伸,因为内容高度反馈到了窗口尺寸计算 中。通过将布局与父级填充锚定解耦并设置固定的默认高度,对话框现在能正确遵 循其最小高度并正确调整内容尺寸。 Influence: 1. 打开设置对话框,验证其以最小高度打开且无拉伸 2. 调整对话框窗口大小,确认内容正确适配 3. 验证标题栏在移除填充宽度布局属性后正常渲染 4. 测试内容超出窗口高度时对话框内的滚动 5. 检查不同 DPI 缩放下对话框渲染是否正确 6. 验证对话框内容边距和内边距无视觉回归 PMS: TASK-398041 --- qt6/src/qml/DialogWindow.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/qt6/src/qml/DialogWindow.qml b/qt6/src/qml/DialogWindow.qml index 1fd76af3b..fce494ee4 100644 --- a/qt6/src/qml/DialogWindow.qml +++ b/qt6/src/qml/DialogWindow.qml @@ -66,8 +66,6 @@ Window { Loader { id: titleBar - Layout.fillWidth: true - Layout.preferredWidth: item ? item.implicitWidth : 0 z: D.DTK.TopOrder sourceComponent: DialogTitleBar { enableInWindowBlendBlur: false From 81faff26ec82e3e08848017a04b50f72b24df5f2 Mon Sep 17 00:00:00 2001 From: chenyuanbo Date: Tue, 27 Oct 2026 16:43:28 +0800 Subject: [PATCH 27/31] fix: silence -Wunused-result in color selector unit test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Wrap the bare qWaitFor() call added by ccb129a in EXPECT_TRUE() 2. Silence GCC -Wunused-result on Qt 6, which breaks the -Werror build 3. Test now fails when the palette binding never settles Log: No user-facing changes Influence: 1. Build the unit-test target in Debug with warnings treated as errors 2. Run unit-test --gtest_filter='ut_ColorSelector.*', expect 4 passed 3. Break the palette binding on purpose to verify the new assert fires fix: 修复颜色选择器单测 qWaitFor 返回值未使用告警 1. 将 ccb129a 引入的裸 qWaitFor() 调用包进 EXPECT_TRUE() 2. 消除 Qt6 上的 GCC -Wunused-result 告警,避免 -Werror 下编译失败 3. 调色板绑定未生效时用例会断言失败,而不是静默通过 Log: 无用户可见变化 Influence: 1. Debug 配置下构建 unit-test 目标,确认无告警、编译通过 2. 运行 unit-test --gtest_filter='ut_ColorSelector.*',预期 4 个用例通过 3. 临时破坏调色板绑定,确认新加的断言能让用例失败 PMS: TASK-397289 --- tests/ut_colorselector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ut_colorselector.cpp b/tests/ut_colorselector.cpp index ce749ccd4..ad970e22b 100644 --- a/tests/ut_colorselector.cpp +++ b/tests/ut_colorselector.cpp @@ -53,10 +53,10 @@ TEST_F(ut_ColorSelector, getColorFromProperty) engine.globalObject().setProperty("background", engine.newQObject(background)); ASSERT_TRUE(QQmlProperty::write(helper.object, "palette.window", QColor(Qt::white))); - QTest::qWaitFor([&] { + EXPECT_TRUE(QTest::qWaitFor([&] { return background->property("color") == engine.evaluate("background.color1.normal.common.color()").toVariant(); - }); + })); ASSERT_EQ(background->property("color"), engine.evaluate("background.color1.normal.common.color()").toVariant()); } From 73eb9e54a97816402d82fcf3c89900e3d3f40531 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 Nov 2026 20:32:44 +0800 Subject: [PATCH 28/31] chore: New release 6.7.53 Log: --- CHANGELOG.md | 13 +++++++++++++ VERSION | 2 +- archlinux/PKGBUILD | 2 +- debian/changelog | 6 ++++++ 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5a91b9cf..aa538cc3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.7.53] - 2026-11-10 + +### Fixed + +- Preserve Qt6 text field cursor with TapHandler +- Cancel pending URL loads when setting base64 icon +- Adjust dialog layout sizing to prevent stretch issues +- Silence -Wunused-result in color selector unit test + +### Removed + +- Delete backdrop renderer on invalidated + ## [6.7.52] - 2026-10-28 ### Added diff --git a/VERSION b/VERSION index 95f41b0c7..3a6d46afc 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.7.52 +6.7.53 diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index ee2801f24..3bec90b5e 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: zccrs pkgname=dtkdeclarative-git -pkgver=6.7.52 +pkgver=6.7.53 pkgrel=1 sourcename=dtkdeclarative sourcetars=("$sourcename"_"$pkgver".tar.xz) diff --git a/debian/changelog b/debian/changelog index 5ae3aec56..83b3f79a9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dtkdeclarative (6.7.53) unstable; urgency=medium + + * Release 6.7.53 + + -- yeshanshan Tue, 10 Nov 2026 20:32:44 +0800 + dtkdeclarative (6.7.52) unstable; urgency=medium * Release 6.7.52 From 0b5f75783299f985c0141c05053217e97b691c15 Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Wed, 11 Nov 2026 16:36:20 +0800 Subject: [PATCH 29/31] fix: prevent Qt6 menu from closing on Alt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QQuickMenu closes on Alt press whenever QKeySequence::mnemonic("&A") is non-empty. Mnemonics are enabled by default on Linux. The handler neither checks for a parent menu bar nor waits for the remaining keys of a shortcut, so an Alt-based screenshot shortcut loses the popup before the full combination is entered. Qt dev still has this branch; upstream Qt 5.15.8 QQuickMenu does not. QWidget QMenu instead consults SH_MenuBar_AltKeyNavigation. Fusion enables it, while the observed Chameleon environment leaves it disabled. Mnemonic support and closing menus on Alt are separate policies; disabling process-wide mnemonics would affect unrelated controls. Accept Alt press events in the Qt6 menu contentItem FocusScope before they reach QQuickMenu. Give the scope focus so the handler also runs when no menu item is selected. This matches QWidget menus with SH_MenuBar_AltKeyNavigation disabled and preserves other key handling. Built Qt6 with six parallel jobs and passed git diff --check. Qt Quick Test against the built module on isolated X11 reported 10 passes, covering Popup.Item and Popup.Window, selected and unselected menus, Alt press/release, arrow navigation, Escape, mnemonics and submenus. Basic Alt tests also passed offscreen; mnemonic and submenu tests after switching popup types failed there, then passed on X11. Actual system screenshot shortcuts and Wayland remain unverified. Qt6 的 QQuickMenu 在 Alt 按下时,只要全局助记键检测结果非空就直接关闭菜单。 Linux 默认启用助记键;该分支不检查父菜单栏,也不等待组合快捷键输入完成, 因此含 Alt 的截图快捷键尚未按完,弹出菜单就已消失。 当前 Qt dev 仍保留该分支,而 Qt 5.15.8 上游 QQuickMenu 没有此逻辑。 QWidget QMenu 根据 SH_MenuBar_AltKeyNavigation 决定是否关闭菜单。 Fusion 启用该策略,会关闭菜单;当前 Chameleon 环境未启用,因此不会关闭。 助记键与 Alt 关闭菜单应分别控制,全局禁用助记键会影响应用中的其他控件。 在 Qt6 Menu 的内容项 FocusScope 中接受 Alt 按下事件,阻止其进入 Qt 关闭分支。 设置 focus=true,覆盖菜单刚打开、尚未选中菜单项时焦点停在内部弹出项的情况。 其他按键继续传递,不修改进程级助记键设置,实现与 QWidget 关闭该导航策略 一致的菜单行为。 验证:6 核 Qt6 构建及差异格式检查通过。使用构建产物在隔离 X11 环境运行 Qt Quick Test,10 项结果全部通过,覆盖两种弹出方式、选中与未选中菜单项、 Alt 按下与释放、方向键、Esc、助记键及子菜单。 offscreen 基础 Alt 测试通过,但切换弹出方式后的助记键和子菜单测试失败, 改用 X11 验证后全部通过。实际系统截图快捷键及 Wayland 尚未验证。 Log: 修复 Qt6 菜单按下 Alt 提前关闭,影响组合快捷键截图的问题 PMS: BUG-355869 Influence: DTK Qt6 默认菜单及子菜单按 Alt 不再关闭;Qt5 不变。 使用自定义 contentItem 的应用需要另行验证。 --- qt6/src/qml/Menu.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/qt6/src/qml/Menu.qml b/qt6/src/qml/Menu.qml index b3a07729b..9b71d97e9 100644 --- a/qt6/src/qml/Menu.qml +++ b/qt6/src/qml/Menu.qml @@ -42,8 +42,17 @@ T.Menu { contentItem: FocusScope { // QTBUG-99897 focus doesn't be clear. + // Handle keys even before a menu item is selected. + focus: true implicitWidth: viewLayout.implicitWidth implicitHeight: viewLayout.implicitHeight + + // Match QWidget menus with SH_MenuBar_AltKeyNavigation disabled. + Keys.onPressed: function(event) { + if (event.key === Qt.Key_Alt) + event.accepted = true + } + ColumnLayout { id: viewLayout spacing: 0 From 964437cc4031199d6316d7fac5dc178bc95f3634 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 18 Nov 2026 16:43:57 +0800 Subject: [PATCH 30/31] chore: New release 6.7.54 Log: --- CHANGELOG.md | 6 ++++++ VERSION | 2 +- archlinux/PKGBUILD | 2 +- debian/changelog | 6 ++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aa538cc3a..226d46ea5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [6.7.54] - 2026-11-18 + +### Fixed + +- Prevent Qt6 menu from closing on Alt + ## [6.7.53] - 2026-11-10 ### Fixed diff --git a/VERSION b/VERSION index 3a6d46afc..96fe3bb10 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.7.53 +6.7.54 diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD index 3bec90b5e..d6ff8d90e 100644 --- a/archlinux/PKGBUILD +++ b/archlinux/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: zccrs pkgname=dtkdeclarative-git -pkgver=6.7.53 +pkgver=6.7.54 pkgrel=1 sourcename=dtkdeclarative sourcetars=("$sourcename"_"$pkgver".tar.xz) diff --git a/debian/changelog b/debian/changelog index 83b3f79a9..57fcd4013 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dtkdeclarative (6.7.54) unstable; urgency=medium + + * Release 6.7.54 + + -- yeshanshan Wed, 18 Nov 2026 16:43:56 +0800 + dtkdeclarative (6.7.53) unstable; urgency=medium * Release 6.7.53 From e23348142d73ad2c6f04da1f01008f8b7409fc22 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Thu, 15 Oct 2026 09:32:42 +0800 Subject: [PATCH 31/31] fix(qml): correct dropdown sizing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Measure realized visible items and retain their maximum width. 2. Use visible row height and laid-out content to size the list. 3. Keep ComboBox delegate implicit width independent of popup width. 4. Keep the measured row height until the model changes. 5. Remeasure on each show so the popup shrinks after a smaller font. Log: Correct dropdown width measurement and height sizing Influence: Improve dropdown sizing and item visibility. fix(qml): 修正下拉列表尺寸计算 1. 测量已创建的可见项并保留最大宽度。 2. 使用可见项行高和布局后的内容计算列表高度。 3. 移除组合框委托隐式宽度对弹窗宽度的依赖。 4. 保留已测得的行高直到模型变化,避免拖动越界时弹窗高度跳变。 5. 每次显示弹窗时重新测量,字体变小后弹窗能缩回。 Log: 修正下拉列表宽度测量和高度计算 PMS: BUG-377521 Influence: 改善下拉列表尺寸和选项显示。 --- qt6/src/qml/ArrowListView.qml | 59 ++++++++++++++++++++++++----------- qt6/src/qml/ComboBox.qml | 3 +- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/qt6/src/qml/ArrowListView.qml b/qt6/src/qml/ArrowListView.qml index eb7c880c2..eb2e848a3 100644 --- a/qt6/src/qml/ArrowListView.qml +++ b/qt6/src/qml/ArrowListView.qml @@ -15,20 +15,32 @@ FocusScope { property int itemHeight: DS.Style.arrowListView.itemHeight property alias view: itemsView + // Fixed per show: rows realized while scrolling can differ in height. + property real _measuredRowHeight: 0 + readonly property real _rowHeight: _measuredRowHeight > 0 ? _measuredRowHeight : itemHeight + // Full height of the list, to size a popup before it is mapped. readonly property real sizedHeight: { if (itemsView.count === 0) return 0 - const item = itemsView.itemAtIndex(0) - const measured = itemsView.contentHeight > 0 && item ? (item.height || item.implicitHeight) : 0 + if (itemsView.contentHeight > 0) + return implicitHeight const arrowStrips = itemsView.count > maxVisibleItems ? 2 * (DS.Style.arrowListView.stepButtonIconSize.height + contentLayout.spacing) : 0 - return Math.min(itemsView.count, maxVisibleItems) * (measured > 0 ? measured : itemHeight) + arrowStrips + return Math.min(itemsView.count, maxVisibleItems) * _rowHeight + arrowStrips } implicitWidth: Math.max(DS.Style.arrowListView.width, contentLayout.implicitWidth) implicitHeight: contentLayout.implicitHeight + onVisibleChanged: { + if (!visible) + return + itemsView.itemMaxWidth = 0 + _measuredRowHeight = 0 + itemsView.refreshContentItemWidth() + } + ColumnLayout { id: contentLayout anchors.fill: parent @@ -44,21 +56,14 @@ FocusScope { ListView { id: itemsView + property real itemMaxWidth: 0 clip: true Layout.fillWidth: true Layout.fillHeight: true onHeightChanged: if (height > 0 && contentHeight === 0) forceLayout() - implicitHeight: itemsView.count > 0 ? Math.min(contentHeight, maxVisibleItems * contentHeight / itemsView.count) : 0 - implicitWidth:{ - var maxWidth = DS.Style.arrowListView.width - for (var i = 0; i < itemsView.count; ++i) { - var item = itemsView.itemAtIndex(i) - if (item && item.implicitWidth > maxWidth) - maxWidth = item.implicitWidth - } - return maxWidth - } - interactive: itemsView.count > maxVisibleItems + implicitHeight: itemsView.count > 0 ? Math.min(contentHeight, maxVisibleItems * control._rowHeight) : 0 + implicitWidth: itemMaxWidth + interactive: itemsView.contentHeight > itemsView.height ScrollIndicator.vertical: ScrollIndicator { } highlight: HighlightPanel { visible: false // TODO listview's highlight is confict with Item's highlight. @@ -76,16 +81,34 @@ FocusScope { highlightMoveDuration: -1 highlightMoveVelocity: 400 - onCountChanged: refreshContentItemWidth() + Connections { + target: itemsView.contentItem + function onChildrenChanged() { Qt.callLater(itemsView.refreshContentItemWidth) } + } + + onCountChanged: { + itemMaxWidth = 0 + control._measuredRowHeight = 0 + refreshContentItemWidth() + } + + onContentHeightChanged: if (control._measuredRowHeight <= 0) refreshContentItemWidth() + onWidthChanged: refreshContentItemWidth() function refreshContentItemWidth() { + var maxWidth = itemMaxWidth for (var i = 0; i < itemsView.count; ++i) { var item = itemsView.itemAtIndex(i) - if (item) { - item.width = itemsView.width - } + if (!item || !item.visible) + continue + item.width = itemsView.width + if (control._measuredRowHeight <= 0 && item.height > 0) + control._measuredRowHeight = item.height + if (item.implicitWidth > maxWidth) + maxWidth = item.implicitWidth } + itemMaxWidth = maxWidth } } diff --git a/qt6/src/qml/ComboBox.qml b/qt6/src/qml/ComboBox.qml index 9f3d53416..7d61c936c 100644 --- a/qt6/src/qml/ComboBox.qml +++ b/qt6/src/qml/ComboBox.qml @@ -33,7 +33,6 @@ T.ComboBox { bottomPadding: control.flat ? 0 : padding delegate: MenuItem { - implicitWidth: Math.max(DS.Style.control.implicitWidth(control), popup.implicitWidth - DS.Style.popup.margin * 2) useIndicatorPadding: true text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : (model[control.textRole] === undefined ? modelData[control.textRole] : model[control.textRole])) : modelData icon.name: (control.iconNameRole && model[control.iconNameRole] !== undefined) ? model[control.iconNameRole] : null @@ -172,7 +171,7 @@ T.ComboBox { leftMargin: DS.Style.popup.margin rightMargin: DS.Style.popup.margin palette: control.palette - implicitWidth: control.flat ? Math.max(contentItem.implicitWidth, control.width) : control.width + implicitWidth: control.flat ? Math.max(contentItem.implicitWidth + leftPadding + rightPadding, control.width) : control.width // 60 is a temporary viewport so the list can realize one row and be measured. implicitHeight: (contentItem.sizedHeight > 0 ? contentItem.sizedHeight : 2 * DS.Style.arrowListView.itemHeight) + topPadding + bottomPadding