From c5fd5b1e4dd69dcc91e3af22c58adb6fecfc1b7f Mon Sep 17 00:00:00 2001 From: Pascal Precht Date: Fri, 4 Dec 2020 11:32:59 +0100 Subject: [PATCH] feat(StatusIconButton): make highlighted and hovered colors configurable --- ui/shared/status/StatusIconButton.qml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ui/shared/status/StatusIconButton.qml b/ui/shared/status/StatusIconButton.qml index cf8993203f..7e7e1751ae 100644 --- a/ui/shared/status/StatusIconButton.qml +++ b/ui/shared/status/StatusIconButton.qml @@ -9,6 +9,9 @@ RoundButton { property string type: "primary" property color iconColor: Style.current.secondaryText + property color highlightedIconColor: Style.current.blue + property color hoveredIconColor: Style.current.blue + property color highlightedBackgroundColor: Style.current.secondaryBackground property color disabledColor: iconColor property int iconRotation: 0 @@ -22,7 +25,14 @@ RoundButton { return control.disabledColor } - return (hovered || highlighted) ? Style.current.blue : control.iconColor + if (hovered) { + return control.hoveredIconColor + } + + if (highlighted) { + return control.highlightedIconColor + } + return control.iconColor } radius: Style.current.radius @@ -36,7 +46,7 @@ RoundButton { if (type === "secondary") { return "transparent" } - return hovered || highlighted ? Style.current.secondaryBackground : "transparent" + return hovered || highlighted ? control.highlightedBackgroundColor : "transparent" } radius: control.radius } @@ -56,6 +66,7 @@ RoundButton { rotation: control.iconRotation } ColorOverlay { + visible: control.visible anchors.fill: iconImg source: iconImg color: control.icon.color @@ -63,7 +74,6 @@ RoundButton { smooth: true rotation: control.iconRotation } - } MouseArea {