Restore icon colors

This commit is contained in:
miruka 2019-08-28 18:21:13 -04:00
parent 4bee87ed5d
commit 6cda69ad67
9 changed files with 27 additions and 3 deletions

View File

@ -3,7 +3,6 @@
- Theming
- File format
- Make all icon SVG files white/black, since we can now use ColorOverlay
- Gray colored buttons when disabled
- Make the icon blue in EditAccount when hovering and no avatar set
- Remove the filled theme
@ -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)`

View File

@ -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

View File

@ -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

View File

@ -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
}
]

View File

@ -15,6 +15,7 @@ Banner {
name: "forget",
text: qsTr("Forget"),
iconName: "room-forget",
iconColor: theme.colors.negativeBackground
}
]

View File

@ -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()

View File

@ -81,6 +81,7 @@ HTileDelegate {
contextMenu: HMenu {
HMenuItem {
icon.name: "logout"
icon.color: theme.colors.negativeBackground
text: qsTr("Logout")
onTriggered: {
disconnecting = true

View File

@ -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(

View File

@ -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)