From e82ce778a2b6a7f6f338c8b0c2e445e14f21efa2 Mon Sep 17 00:00:00 2001 From: dss Date: Fri, 16 Oct 2026 15:01:08 +0800 Subject: [PATCH] fix(ActionButton): add hover and pressed color states for icon in input fields - hover: icon color becomes opaque foreground (alpha 1.0) - pressed: icon color becomes active highlight color - palette.windowText now always bound to ColorSelector.textColor so the palette system picks up all states automatically - adapts to light/dark themes via the palette system --- qt6/src/qml/ActionButton.qml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/qt6/src/qml/ActionButton.qml b/qt6/src/qml/ActionButton.qml index e735d25ad..cc6e403a1 100644 --- a/qt6/src/qml/ActionButton.qml +++ b/qt6/src/qml/ActionButton.qml @@ -9,9 +9,17 @@ import org.deepin.dtk.style 1.0 as DS T.Button { id: control - property D.Palette textColor: DS.Style.button.text + property D.Palette textColor: D.Palette { + normal { + common: Qt.rgba(0, 0, 0, 0.7) + } + hovered { + common: Qt.rgba(0, 0, 0, 1) + } + pressed: D.DTK.makeColor(D.Color.Highlight) + } - palette.windowText: pressed ? D.ColorSelector.textColor : undefined + palette.windowText: D.ColorSelector.textColor opacity: D.ColorSelector.controlState === D.DTK.DisabledState ? 0.4 : 1 implicitWidth: DS.Style.control.implicitWidth(control) implicitHeight: DS.Style.control.implicitHeight(control)