Support user messages on the right even when wide
Limit maximum delegate width to ensure that the gap between user and non-user messages isn't too large
This commit is contained in:
@@ -17,7 +17,6 @@ import NeoChat.Menu.Timeline 1.0
|
|||||||
TimelineContainer {
|
TimelineContainer {
|
||||||
id: audioDelegate
|
id: audioDelegate
|
||||||
|
|
||||||
width: ListView.view.width
|
|
||||||
onReplyClicked: ListView.view.goToEvent(eventID)
|
onReplyClicked: ListView.view.goToEvent(eventID)
|
||||||
hoverComponent: hoverActions
|
hoverComponent: hoverActions
|
||||||
innerObject: Control {
|
innerObject: Control {
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import org.kde.neochat 1.0
|
|||||||
|
|
||||||
TimelineContainer {
|
TimelineContainer {
|
||||||
id: encryptedDelegate
|
id: encryptedDelegate
|
||||||
width: ListView.view.width
|
|
||||||
|
|
||||||
innerObject: TextEdit {
|
innerObject: TextEdit {
|
||||||
text: i18n("This message is encrypted and the sender has not shared the key with this device.")
|
text: i18n("This message is encrypted and the sender has not shared the key with this device.")
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import NeoChat.Menu.Timeline 1.0
|
|||||||
|
|
||||||
TimelineContainer {
|
TimelineContainer {
|
||||||
id: fileDelegate
|
id: fileDelegate
|
||||||
width: ListView.view.width
|
|
||||||
|
|
||||||
onReplyClicked: ListView.view.goToEvent(eventID)
|
onReplyClicked: ListView.view.goToEvent(eventID)
|
||||||
hoverComponent: hoverActions
|
hoverComponent: hoverActions
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ import NeoChat.Menu.Timeline 1.0
|
|||||||
TimelineContainer {
|
TimelineContainer {
|
||||||
id: imageDelegate
|
id: imageDelegate
|
||||||
|
|
||||||
width: ListView.view.width
|
|
||||||
|
|
||||||
onReplyClicked: ListView.view.goToEvent(eventID)
|
onReplyClicked: ListView.view.goToEvent(eventID)
|
||||||
hoverComponent: hoverActions
|
hoverComponent: hoverActions
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import org.kde.neochat 1.0
|
|||||||
TimelineContainer {
|
TimelineContainer {
|
||||||
id: messageDelegate
|
id: messageDelegate
|
||||||
|
|
||||||
width: ListView.view.width
|
|
||||||
property bool isEmote: false
|
property bool isEmote: false
|
||||||
|
|
||||||
onReplyClicked: ListView.view.goToEvent(eventID)
|
onReplyClicked: ListView.view.goToEvent(eventID)
|
||||||
|
|||||||
@@ -19,12 +19,11 @@ QQC2.ItemDelegate {
|
|||||||
property bool isEmote: false
|
property bool isEmote: false
|
||||||
property bool cardBackground: true
|
property bool cardBackground: true
|
||||||
|
|
||||||
|
readonly property int delegateMaxWidth: Math.min(messageListView.width, Kirigami.Units.gridUnit * 40)
|
||||||
readonly property int bubbleMaxWidth: Config.compactLayout && !Config.showAvatarInTimeline ? width - Kirigami.Units.largeSpacing * 4 : (Config.compactLayout ? width - Kirigami.Units.gridUnit * 2 - Kirigami.Units.largeSpacing * 4 : Math.min(width - Kirigami.Units.gridUnit * 2 - Kirigami.Units.largeSpacing * 6, Kirigami.Units.gridUnit * 20))
|
readonly property int bubbleMaxWidth: Config.compactLayout && !Config.showAvatarInTimeline ? width - Kirigami.Units.largeSpacing * 4 : (Config.compactLayout ? width - Kirigami.Units.gridUnit * 2 - Kirigami.Units.largeSpacing * 4 : Math.min(width - Kirigami.Units.gridUnit * 2 - Kirigami.Units.largeSpacing * 6, Kirigami.Units.gridUnit * 20))
|
||||||
|
|
||||||
property bool showUserMessageOnRight: Config.showLocalMessagesOnRight &&
|
property bool showUserMessageOnRight: Config.showLocalMessagesOnRight &&
|
||||||
model.author.isLocalUser &&
|
model.author.isLocalUser && !Config.compactLayout
|
||||||
!applicationWindow().wideScreen &&
|
|
||||||
!Config.compactLayout
|
|
||||||
|
|
||||||
signal openExternally()
|
signal openExternally()
|
||||||
signal replyClicked(string eventID)
|
signal replyClicked(string eventID)
|
||||||
@@ -37,6 +36,7 @@ QQC2.ItemDelegate {
|
|||||||
|
|
||||||
topPadding: 0
|
topPadding: 0
|
||||||
bottomPadding: 0
|
bottomPadding: 0
|
||||||
|
width: delegateMaxWidth
|
||||||
background: null
|
background: null
|
||||||
property Item hoverComponent
|
property Item hoverComponent
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,6 @@ import NeoChat.Menu.Timeline 1.0
|
|||||||
TimelineContainer {
|
TimelineContainer {
|
||||||
id: videoDelegate
|
id: videoDelegate
|
||||||
|
|
||||||
width: ListView.view.width
|
|
||||||
|
|
||||||
onReplyClicked: ListView.view.goToEvent(eventID)
|
onReplyClicked: ListView.view.goToEvent(eventID)
|
||||||
hoverComponent: hoverActions
|
hoverComponent: hoverActions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user