Adds the ability to show avatars in the sidebar independently of whether they are shown in the chat area.

Fix #408
This commit is contained in:
Milo Kerr
2021-08-11 20:33:56 +00:00
committed by Carl Schwan
parent e91a4f79a5
commit e064243d66
3 changed files with 20 additions and 6 deletions

View File

@@ -198,7 +198,7 @@ Kirigami.OverlayDrawer {
Kirigami.Avatar {
Layout.preferredWidth: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 2.5
Layout.preferredHeight: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 2.5
visible: Config.showAvatarInTimeline
visible: Config.showAvatarInRoomDrawer
sourceSize.height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 2.5
sourceSize.width: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 2.5
source: avatar ? ("image://mxc/" + avatar) : ""

View File

@@ -173,14 +173,22 @@ Kirigami.ScrollablePage {
}
Kirigami.FormLayout {
QQC2.CheckBox {
text: i18n("Show User Avatar")
Kirigami.FormData.label: "Show Avatar:"
text: i18n("In Chat")
checked: Config.showAvatarInTimeline
onToggled: {
Config.showAvatarInTimeline = checked;
Config.save();
Config.showAvatarInTimeline = checked
Config.save()
}
}
QQC2.CheckBox {
text: i18n("In Sidebar")
checked: Config.showAvatarInRoomDrawer
onToggled: {
Config.showAvatarInRoomDrawer = checked
Config.save()
}
}
QQC2.CheckBox {
text: i18n("Show Fancy Effects")
checked: Config.showFancyEffects
@@ -217,7 +225,7 @@ Kirigami.ScrollablePage {
Config.transparency = value;
Config.save();
}
HoverHandler { id: sliderHover }
QQC2.ToolTip.visible: sliderHover.hovered && !enabled
QQC2.ToolTip.text: i18n("Only enabled if the transparent chat page is enabled.")

View File

@@ -75,5 +75,11 @@
<default>true</default>
</entry>
</group>
<group name="RoomDrawer">
<entry name="ShowAvatarInRoomDrawer" type="bool">
<label>Show avatar in the room drawer</label>
<default>true</default>
</entry>
</group>
</kcfg>