From 664051ab890373cb54d24edc04f9453df0bb95f5 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Fri, 21 Feb 2025 09:34:30 +0000 Subject: [PATCH] sync: from linuxdeepin/dtkdeclarative Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: https://github.com/linuxdeepin/dtkdeclarative/pull/462 --- qt6/src/qml/ComboBox.qml | 5 +++++ qt6/src/qml/FocusBoxBorder.qml | 4 ++-- qt6/src/qml/Slider.qml | 6 ++++++ qt6/src/qml/Switch.qml | 5 +++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/qt6/src/qml/ComboBox.qml b/qt6/src/qml/ComboBox.qml index da17da9..4b89513 100644 --- a/qt6/src/qml/ComboBox.qml +++ b/qt6/src/qml/ComboBox.qml @@ -148,6 +148,11 @@ T.ComboBox { } } } + Loader { + anchors.fill: parent + active: control.flat && control.visualFocus + sourceComponent: FocusBoxBorder {} + } } popup: Popup { diff --git a/qt6/src/qml/FocusBoxBorder.qml b/qt6/src/qml/FocusBoxBorder.qml index 5af7330..91439a1 100644 --- a/qt6/src/qml/FocusBoxBorder.qml +++ b/qt6/src/qml/FocusBoxBorder.qml @@ -8,9 +8,9 @@ import org.deepin.dtk.style 1.0 as DS Item { id: control - property color color: "transparent" + property color color: palette.highlight property real borderWidth: DS.Style.control.focusBorderWidth - property real radius: 0 + property real radius: DS.Style.control.radius Rectangle { id: _border diff --git a/qt6/src/qml/Slider.qml b/qt6/src/qml/Slider.qml index 0a3fd14..a37803f 100644 --- a/qt6/src/qml/Slider.qml +++ b/qt6/src/qml/Slider.qml @@ -43,6 +43,12 @@ T.Slider { palette: D.DTK.makeIconPalette(control.palette) mode: control.D.ColorSelector.controlState theme: control.D.ColorSelector.controlTheme + + Loader { + anchors.fill: parent + active: control.visualFocus + sourceComponent: FocusBoxBorder {} + } } // draw panel diff --git a/qt6/src/qml/Switch.qml b/qt6/src/qml/Switch.qml index 8671af6..a79a862 100644 --- a/qt6/src/qml/Switch.qml +++ b/qt6/src/qml/Switch.qml @@ -114,4 +114,9 @@ T.Switch { text: control.text verticalAlignment: Text.AlignVCenter } + + background: Loader { + active: control.visualFocus + sourceComponent: FocusBoxBorder {} + } }