diff --git a/ui/imports/Themes/DarkTheme.qml b/ui/imports/Themes/DarkTheme.qml index f240519169..7b9c020f04 100644 --- a/ui/imports/Themes/DarkTheme.qml +++ b/ui/imports/Themes/DarkTheme.qml @@ -60,6 +60,7 @@ Theme { property color buttonDisabledForegroundColor: buttonSecondaryColor property color buttonDisabledBackgroundColor: evenDarkerGrey property color buttonWarnBackgroundColor: "#FFEAEE" + property color buttonHoveredWarnBackgroundColor: red property color buttonHoveredBackgroundColor: blue property color roundedButtonForegroundColor: white diff --git a/ui/imports/Themes/LightTheme.qml b/ui/imports/Themes/LightTheme.qml index 08f3a7b495..aaa3b007c8 100644 --- a/ui/imports/Themes/LightTheme.qml +++ b/ui/imports/Themes/LightTheme.qml @@ -59,6 +59,7 @@ Theme { property color buttonDisabledForegroundColor: buttonSecondaryColor property color buttonDisabledBackgroundColor: grey property color buttonWarnBackgroundColor: "#FFEAEE" + property color buttonHoveredWarnBackgroundColor: red property color buttonHoveredBackgroundColor: blue property color roundedButtonForegroundColor: buttonForegroundColor diff --git a/ui/shared/status/StatusButton.qml b/ui/shared/status/StatusButton.qml index 2227acf480..97505b2251 100644 --- a/ui/shared/status/StatusButton.qml +++ b/ui/shared/status/StatusButton.qml @@ -12,14 +12,23 @@ Button { property color color: type === "warn" ? Style.current.danger : Style.current.buttonForegroundColor property color bgColor: type === "warn" ? Style.current.buttonWarnBackgroundColor : Style.current.buttonBackgroundColor property color borderColor: color - property color bgHoverColor: bgColor !== Style.current.transparent ? Qt.darker(control.bgColor, 1.1) : - type === "warn" ? Style.current.buttonWarnBackgroundColor : Style.current.buttonBackgroundColor + property color hoveredBorderColor + property color bgHoverColor: { + if (type === "warn") { + if (showBorder) { + return Style.current.buttonWarnBackgroundColor + } + return Utils.setColorAlpha(Style.current.buttonHoveredWarnBackgroundColor, 0.2) + } + return Utils.setColorAlpha(Style.current.buttonHoveredBackgroundColor, 0.2) + } property bool disableColorOverlay: false property bool showBorder: false property int iconRotation: 0 id: control font.pixelSize: size === "small" ? 13 : 15 + font.family: Style.current.fontRegular.name font.weight: Font.Medium implicitHeight: flat ? 32 : (size === "small" ? 38 : 44) implicitWidth: buttonLabel.implicitWidth + (flat ? 3* Style.current.halfPadding : 2 * Style.current.padding) + @@ -69,8 +78,15 @@ Button { anchors.right: iconLoader.active ? undefined : parent.right anchors.left: iconLoader.active ? iconLoader.right : parent.left anchors.leftMargin: iconLoader.active ? Style.current.smallPadding : 0 - color: !enabled ? Style.current.buttonDisabledForegroundColor : - (type !== "warn" && (hovered || highlighted)) ? Style.current.blue : control.color + color: { + if (!enabled) { + return Style.current.buttonDisabledForegroundColor + } else if (type !== "warn" && (hovered || highlighted)) { + return control.color !== Style.current.buttonForegroundColor ? + control.color : Style.current.blue + } + return control.color + } visible: !loadingIndicator.active } @@ -98,7 +114,15 @@ Button { radius: Style.current.radius anchors.fill: parent border.width: flat || showBorder ? 1 : 0 - border.color: hovered || showBorder ? control.borderColor : Style.current.transparent + border.color: { + if (hovered) { + return !!control.hoveredBorderColor ? control.hoveredBorderColor : control.borderColor + } + if (showBorder) { + return control.borderColor + } + return Style.current.transparent + } color: { if (flat) { return "transparent"