Add option to toggle the display of users avatar in timeline on and off

This commit is contained in:
Carl Schwan
2020-12-02 18:25:29 +01:00
parent 1d5f1633bd
commit 8a3659efba
4 changed files with 15 additions and 3 deletions

View File

@@ -50,7 +50,7 @@ RowLayout {
Layout.alignment: Qt.AlignTop
visible: showAuthor
visible: showAuthor && Config.showAvatarInTimeline
name: author.displayName
source: author.avatarMediaId ? "image://mxc/" + author.avatarMediaId : ""
color: author.color
@@ -70,7 +70,7 @@ RowLayout {
Item {
Layout.minimumWidth: Kirigami.Units.gridUnit * 2
Layout.preferredHeight: 1
visible: !showAuthor
visible: !showAuthor && Config.showAvatarInTimeline
}

View File

@@ -28,7 +28,7 @@ QQC2.AbstractButton {
Layout.preferredWidth: Kirigami.Units.gridUnit
Layout.preferredHeight: Kirigami.Units.gridUnit
Layout.alignment: Qt.AlignTop
visible: Config.showAvatarInTimeline
source: replyVisible && reply.author.avatarMediaId ? "image://mxc/" + reply.author.avatarMediaId : ""
name: replyVisible ? reply.author.displayName : "H"
color: replyVisible ? reply.author.color : Kirigami.Theme.highlightColor

View File

@@ -40,5 +40,11 @@ Kirigami.ScrollablePage {
checked: Config.mergeRoomList
onToggled: Config.mergeRoomList = true
}
QQC2.CheckBox {
Kirigami.FormData.label: i18n("Timeline:")
text: i18n("Show User Avatar")
checked: Config.showAvatarInTimeline
onToggled: Config.showAvatarInTimeline = checked
}
}
}

View File

@@ -24,5 +24,11 @@
<default>true</default>
</entry>
</group>
<group name="Timeline">
<entry name="ShowAvatarInTimeline" type="bool">
<label>Show avatar in the timeline</label>
<default>true</default>
</entry>
</group>
</kcfg>