Add ownMessagesOnLeftAboveWidth setting

Replaces the theme eventList.ownEventsOnRightUnderWidth property.
Can be set to -1 to always keep our own messages on the right.
This commit is contained in:
miruka 2020-05-16 14:36:00 -04:00
parent 60ad7416d9
commit a1b485c039
5 changed files with 8 additions and 7 deletions

View File

@ -239,6 +239,7 @@ class UISettings(JSONDataFile):
"hideMembershipEvents": False,
"hideUnknownEvents": False,
"maxMessageCharactersPerLine": 65,
"ownMessagesOnLeftAboveWidth": 895,
"theme": "Midnight.qpl",
"writeAliases": {},
"media": {

View File

@ -25,7 +25,7 @@ HColumnLayout {
property bool checked: model.id in eventList.checked
property bool compact: window.settings.compactMode
property bool isOwn: chat.userId === model.sender_id
property bool onRight: eventList.ownEventsOnRight && isOwn
property bool onRight: ! eventList.ownEventsOnLeft && isOwn
property bool combine: eventList.canCombine(previousModel, model)
property bool talkBreak: eventList.canTalkBreak(previousModel, model)
property bool dayBreak: eventList.canDayBreak(previousModel, model)

View File

@ -180,8 +180,10 @@ Rectangle {
property bool canLoad: true
property bool loading: false
property bool ownEventsOnRight:
width < theme.chat.eventList.ownEventsOnRightUnderWidth
property bool ownEventsOnLeft:
window.settings.ownMessagesOnLeftAboveWidth < 0 ?
false :
width > window.settings.ownMessagesOnLeftAboveWidth * theme.uiScale
property string delegateWithSelectedText: ""
property string selectedText: ""

View File

@ -356,8 +356,7 @@ chat:
color background: "transparent"
eventList:
int ownEventsOnRightUnderWidth: 896 * theme.uiScale
color background: "transparent"
color background: "transparent"
message:
int avatarSize: 56 * uiScale

View File

@ -365,8 +365,7 @@ chat:
color background: "transparent"
eventList:
int ownEventsOnRightUnderWidth: 896 * theme.uiScale
color background: "transparent"
color background: "transparent"
message:
int avatarSize: 56 * uiScale