From b6290ad3c9496395dc1b0f35118c413695a153db Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 24 Jul 2019 18:41:40 -0400 Subject: [PATCH] Fix SignIn circle buttons colors --- TODO.md | 3 +++ src/qml/Base/HBaseButton.qml | 11 +++++------ src/qml/Pages/SignIn.qml | 1 + src/themes/Default.qpl | 7 ++++++- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/TODO.md b/TODO.md index 2cc3650c..a840c5eb 100644 --- a/TODO.md +++ b/TODO.md @@ -68,6 +68,9 @@ - Prevent using the SendBox if no permission (power levels) - Spinner when loading past room events, images or clicking buttons - Theming + - Don't use user theme in debug mode + - Don't create additional lines in theme conversion (braces) + - Recursively merge default and user theme - Distribute fonts - preferredIconPack: accept multiple values - Find icon packs in user data dir diff --git a/src/qml/Base/HBaseButton.qml b/src/qml/Base/HBaseButton.qml index 46c4cf5a..a5ddb46f 100644 --- a/src/qml/Base/HBaseButton.qml +++ b/src/qml/Base/HBaseButton.qml @@ -25,12 +25,11 @@ Button { background: Rectangle { id: buttonBackground - color: Qt.lighter( - backgroundColor, - ! enabled ? 0.7 : - checked ? (checkedLightens ? 1.3 : 0.7) : - 1.0 - ) + color: + enabled ? + (checked ? + theme.controls.button.checkedBackground : backgroundColor) : + theme.controls.button.disabledBackground radius: circle ? height : 0 Behavior on color { HColorAnimation { factor: 0.5 } } diff --git a/src/qml/Pages/SignIn.qml b/src/qml/Pages/SignIn.qml index 36950af4..bff3d9b9 100644 --- a/src/qml/Pages/SignIn.qml +++ b/src/qml/Pages/SignIn.qml @@ -50,6 +50,7 @@ Item { iconName: modelData circle: true checked: loginWith == modelData + enabled: modelData == "username" autoExclusive: true checkedLightens: true onClicked: loginWith = modelData diff --git a/src/themes/Default.qpl b/src/themes/Default.qpl index b5065494..d2392428 100644 --- a/src/themes/Default.qpl +++ b/src/themes/Default.qpl @@ -76,7 +76,12 @@ controls: color background: colors.strongBackground button: - color background: colors.inputBackground + color background: colors.inputBackground + color disabledBackground: + hsluv(0, 0, colors.intensity * 2, Math.min(0.6, opacity)) + color checkedBackground: + hsluv(0, 0, colors.intensity * 40, Math.min(0.6, opacity)) + color hoveredOverlay: hsluv(0, 0, 100) color text: colors.text color disabledText: colors.dimmerText