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, "hideMembershipEvents": False,
"hideUnknownEvents": False, "hideUnknownEvents": False,
"maxMessageCharactersPerLine": 65, "maxMessageCharactersPerLine": 65,
"ownMessagesOnLeftAboveWidth": 895,
"theme": "Midnight.qpl", "theme": "Midnight.qpl",
"writeAliases": {}, "writeAliases": {},
"media": { "media": {

View File

@ -25,7 +25,7 @@ HColumnLayout {
property bool checked: model.id in eventList.checked property bool checked: model.id in eventList.checked
property bool compact: window.settings.compactMode property bool compact: window.settings.compactMode
property bool isOwn: chat.userId === model.sender_id 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 combine: eventList.canCombine(previousModel, model)
property bool talkBreak: eventList.canTalkBreak(previousModel, model) property bool talkBreak: eventList.canTalkBreak(previousModel, model)
property bool dayBreak: eventList.canDayBreak(previousModel, model) property bool dayBreak: eventList.canDayBreak(previousModel, model)

View File

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

View File

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

View File

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