From 09fcdd0ee601a647898f89776cee9fcb6d733e0b Mon Sep 17 00:00:00 2001 From: liujiangtao Date: Fri, 4 Sep 2026 18:28:06 +0800 Subject: [PATCH] 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/private/dquickdciiconimage.cpp | 2 -- src/private/dquickiconlabel.cpp | 6 +++++- 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 ++- 42 files changed, 96 insertions(+), 38 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..0f2ec2a58 100644 --- a/qt6/src/qml/DialogTitleBar.qml +++ b/qt6/src/qml/DialogTitleBar.qml @@ -65,6 +65,7 @@ Item { id: iconControl visible: iconLabel.name !== "" contentItem: D.DciIcon { + smooth: iconControl.smooth id: iconLabel mode: iconControl.D.ColorSelector.controlState theme: iconControl.D.ColorSelector.controlTheme 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..ce0a2755c 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 @@ -28,6 +28,7 @@ LineEdit { // Search Icon D.DciIcon { + smooth: control.smooth id: searchIcon name: "action_search" sourceSize: Qt.size(DS.Style.searchEdit.iconSize, DS.Style.searchEdit.iconSize) 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..a5810c5af 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 @@ -29,6 +29,7 @@ Control { Component { id: inactiveComponent D.DciIcon { + smooth: control.smooth id: icon sourceSize.width: DS.Style.spinBox.indicator.iconSize palette: D.DTK.makeIconPalette(control.palette) diff --git a/qt6/src/qml/Switch.qml b/qt6/src/qml/Switch.qml index a79a8623f..34dd96b7e 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 @@ -65,6 +66,7 @@ T.Switch { Component { id: animationIndicatorComp D.DciIcon { + smooth: control.smooth id: switchIcon 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..736cb60b9 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 @@ -115,6 +115,7 @@ Item { Layout.leftMargin: DS.Style.titleBar.leftMargin D.DciIcon { + smooth: control.smooth id: iconLabel sourceSize { width: 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/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 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..01a5768eb 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 @@ -65,6 +65,7 @@ Control { Layout.leftMargin: DS.Style.titleBar.leftMargin D.DciIcon { + smooth: control.smooth id: iconLabel visible: name !== "" mode: control.D.ColorSelector.controlState 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..f15f041bc 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 @@ -27,6 +27,7 @@ LineEdit { // Search Icon D.DciIcon { + smooth: control.smooth id: searchIcon name: "action_search" sourceSize.width: DS.Style.searchEdit.iconSize 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..be0527bd0 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 @@ -28,6 +28,7 @@ Control { Component { id: inactiveComponent D.DciIcon { + smooth: control.smooth id: icon sourceSize.width: DS.Style.spinBox.indicator.iconSize palette: D.DTK.makeIconPalette(control.palette) diff --git a/src/qml/Switch.qml b/src/qml/Switch.qml index 2c8f63f18..834321276 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 @@ -32,6 +32,7 @@ T.Switch { opacity: control.D.ColorSelector.controlState === D.DTK.DisabledState ? 0.4 : 1 D.DciIcon { + smooth: control.smooth id: handle x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2))) y: (parent.height - height) / 2 diff --git a/src/qml/TitleBar.qml b/src/qml/TitleBar.qml index bce40fab4..a4564a99e 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 @@ -110,6 +110,7 @@ Control { Layout.leftMargin: DS.Style.titleBar.leftMargin D.DciIcon { + smooth: control.smooth id: iconLabel sourceSize { width: 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..9f9533422 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 @@ -17,6 +17,7 @@ Control { palette.windowText: D.ColorSelector.textColor hoverEnabled: true contentItem: D.DciIcon { + smooth: control.smooth id: iconLoader palette: D.DTK.makeIconPalette(control.palette) sourceSize {