From 6cda69ad67b2a281a7bbb422e50d8353e633ab5d Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 28 Aug 2019 18:21:13 -0400 Subject: [PATCH] Restore icon colors --- TODO.md | 5 ++--- src/qml/Base/HBox.qml | 10 ++++++++++ src/qml/Chat/Banners/Banner.qml | 1 + src/qml/Chat/Banners/InviteBanner.qml | 2 ++ src/qml/Chat/Banners/LeftBanner.qml | 1 + src/qml/Pages/EditAccount/Profile.qml | 2 ++ src/qml/SidePane/DelegateAccount.qml | 1 + src/qml/SidePane/DelegateRoom.qml | 4 ++++ src/themes/Default.qpl | 4 ++++ 9 files changed, 27 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index d41786c9..00606a4b 100644 --- a/TODO.md +++ b/TODO.md @@ -3,8 +3,7 @@ - Theming - File format - - Make all icon SVG files white/black, since we can now use ColorOverlay - - Gray colored buttons when disabled + - Gray colored buttons when disabled - Make the icon blue in EditAccount when hovering and no avatar set - Remove the filled theme - Have a default background @@ -89,7 +88,7 @@ - Theming - Distribute fonts - - preferredIconPack: accept multiple values + - icons.preferredPack: accept multiple values - Find icon packs in user data dir - Correctly implement uiScale/fontScale + ctrl+-= keys - See `QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling)` diff --git a/src/qml/Base/HBox.qml b/src/qml/Base/HBox.qml index 5a85cccd..3f6e6bfb 100644 --- a/src/qml/Base/HBox.qml +++ b/src/qml/Base/HBox.qml @@ -78,6 +78,16 @@ Rectangle { id: button text: modelData.text icon.name: modelData.iconName || "" + icon.color: modelData.iconColor || ( + name == "ok" || name == "apply" || name == "retry" ? + theme.colors.positiveBackground : + + name == "cancel" ? + theme.colors.negativeBackground : + + theme.icons.colorize + ) + enabled: (modelData.enabled == undefined ? true : modelData.enabled) && ! button.loading diff --git a/src/qml/Chat/Banners/Banner.qml b/src/qml/Chat/Banners/Banner.qml index 77712eb2..1145aab7 100644 --- a/src/qml/Chat/Banners/Banner.qml +++ b/src/qml/Chat/Banners/Banner.qml @@ -73,6 +73,7 @@ Rectangle { id: button text: modelData.text icon.name: modelData.iconName + icon.color: modelData.iconColor || theme.icons.colorize onClicked: buttonCallbacks[modelData.name](button) Layout.preferredHeight: theme.baseElementsHeight diff --git a/src/qml/Chat/Banners/InviteBanner.qml b/src/qml/Chat/Banners/InviteBanner.qml index 4a971bfa..8f2df81e 100644 --- a/src/qml/Chat/Banners/InviteBanner.qml +++ b/src/qml/Chat/Banners/InviteBanner.qml @@ -22,11 +22,13 @@ Banner { name: "accept", text: qsTr("Join"), iconName: "invite-accept", + iconColor: theme.colors.positiveBackground }, { name: "decline", text: qsTr("Decline"), iconName: "invite-decline", + iconColor: theme.colors.negativeBackground } ] diff --git a/src/qml/Chat/Banners/LeftBanner.qml b/src/qml/Chat/Banners/LeftBanner.qml index 9fea14cc..2446e171 100644 --- a/src/qml/Chat/Banners/LeftBanner.qml +++ b/src/qml/Chat/Banners/LeftBanner.qml @@ -15,6 +15,7 @@ Banner { name: "forget", text: qsTr("Forget"), iconName: "room-forget", + iconColor: theme.colors.negativeBackground } ] diff --git a/src/qml/Pages/EditAccount/Profile.qml b/src/qml/Pages/EditAccount/Profile.qml index 8cd37b36..e950cc9f 100644 --- a/src/qml/Pages/EditAccount/Profile.qml +++ b/src/qml/Pages/EditAccount/Profile.qml @@ -183,6 +183,7 @@ HGridLayout { id: saveButton icon.name: "apply" + icon.color: theme.colors.positiveBackground text: qsTr("Apply") loading: nameChangeRunning || avatarChangeRunning enabled: @@ -195,6 +196,7 @@ HGridLayout { HButton { icon.name: "cancel" + icon.color: theme.colors.negativeBackground text: qsTr("Cancel") enabled: saveButton.enabled && ! saveButton.loading onClicked: cancelChanges() diff --git a/src/qml/SidePane/DelegateAccount.qml b/src/qml/SidePane/DelegateAccount.qml index bfe9a094..bac9f228 100644 --- a/src/qml/SidePane/DelegateAccount.qml +++ b/src/qml/SidePane/DelegateAccount.qml @@ -81,6 +81,7 @@ HTileDelegate { contextMenu: HMenu { HMenuItem { icon.name: "logout" + icon.color: theme.colors.negativeBackground text: qsTr("Logout") onTriggered: { disconnecting = true diff --git a/src/qml/SidePane/DelegateRoom.qml b/src/qml/SidePane/DelegateRoom.qml index eb2ec277..824fddbf 100644 --- a/src/qml/SidePane/DelegateRoom.qml +++ b/src/qml/SidePane/DelegateRoom.qml @@ -41,6 +41,7 @@ HTileDelegate { additionalInfo.children: HIcon { svgName: "invite-received" + colorize: theme.colors.alertBackground visible: Layout.maximumWidth > 0 Layout.maximumWidth: invited ? implicitWidth : 0 @@ -82,6 +83,7 @@ HTileDelegate { HMenuItem { visible: invited icon.name: "invite-accept" + icon.color: theme.colors.positiveBackground text: qsTr("Accept %1's invite").arg(Utils.coloredNameHtml( model.data.inviter_name, model.data.inviter_id )) @@ -95,6 +97,7 @@ HTileDelegate { HMenuItem { visible: ! model.data.left icon.name: invited ? "invite-decline" : "room-leave" + icon.color: theme.colors.negativeBackground text: invited ? qsTr("Decline invite") : qsTr("Leave") onTriggered: py.callClientCoro( @@ -104,6 +107,7 @@ HTileDelegate { HMenuItem { icon.name: "room-forget" + icon.color: theme.colors.negativeBackground text: qsTr("Forget") onTriggered: py.callClientCoro( diff --git a/src/themes/Default.qpl b/src/themes/Default.qpl index 5a099bf5..5e746a49 100644 --- a/src/themes/Default.qpl +++ b/src/themes/Default.qpl @@ -61,6 +61,10 @@ colors: color negativeBackground: hsluv(0, saturation * 2.25, intensity * 52, Math.max(0.6, opacity)) + color alertBackground: + hsluv(0, saturation * 2.25, intensity * 52, Math.max(0.6, opacity)) + + color brightText: hsluv(0, 0, intensity * 100) color text: hsluv(0, 0, intensity * 80) color halfDimText: hsluv(0, 0, intensity * 70)