Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions qt6/src/qml/AboutDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/ActionButton.qml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/Button.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/ButtonIndicator.qml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -16,6 +16,7 @@ Rectangle {
color: D.ColorSelector.backgroundColor

D.DciIcon {
smooth: control.smooth
anchors.centerIn: parent
sourceSize {
width: DS.Style.buttonIndicator.iconSize
Expand Down
4 changes: 3 additions & 1 deletion qt6/src/qml/CheckBox.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion qt6/src/qml/CheckDelegate.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions qt6/src/qml/ComboBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ T.ComboBox {
}

D.DciIcon {
smooth: control.smooth
sourceSize {
width: DS.Style.comboBox.edit.indicatorSize
height: DS.Style.comboBox.edit.indicatorSize
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/ControlGroup.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions qt6/src/qml/DialogTitleBar.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/IconButton.qml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion qt6/src/qml/ItemDelegate.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion qt6/src/qml/MenuItem.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion qt6/src/qml/RadioButton.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/SearchEdit.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions qt6/src/qml/Slider.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/SpinBoxIndicator.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion qt6/src/qml/Switch.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/TitleBar.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -115,6 +115,7 @@ Item {
Layout.leftMargin: DS.Style.titleBar.leftMargin

D.DciIcon {
smooth: control.smooth
id: iconLabel
sourceSize {
width: DS.Style.titleBar.iconSize
Expand Down
3 changes: 2 additions & 1 deletion qt6/src/qml/ToolButton.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions qt6/src/qml/WindowButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions src/private/dquickdciiconimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)); });
Comment thread
sourcery-ai[bot] marked this conversation as resolved.
}

DQuickDciIconImage::~DQuickDciIconImage()
Expand Down Expand Up @@ -485,7 +484,6 @@ void DQuickDciIconImage::componentComplete()
D_D(DQuickDciIconImage);
d->imageItem->componentComplete();
QQuickItem::componentComplete();
setSmooth(!qFuzzyCompare(scale(), 1.0));
d->layout();
}

Expand Down
6 changes: 5 additions & 1 deletion src/private/dquickiconlabel.cpp
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/qml/AboutDialog.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion src/qml/ActionButton.qml
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/qml/Button.qml
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down
Loading
Loading