summary refs log tree commit diff
path: root/resources/qml/TimelineRow.qml
diff options
context:
space:
mode:
authorMalte E <97891689+maltee1@users.noreply.github.com>2022-02-21 01:39:32 +0100
committerGitHub <noreply@github.com>2022-02-21 00:39:32 +0000
commit1c8a5c645d44fdeb0319cd03dd6986b168d3bf1b (patch)
tree86728c3a544ac5c898a3a34ddc5dff5e4c5202d0 /resources/qml/TimelineRow.qml
parentMerge pull request #951 from maltee1/fix_timeline_scrollbar (diff)
downloadnheko-1c8a5c645d44fdeb0319cd03dd6986b168d3bf1b.tar.xz
Add sender names to state events (#948)
* add sendernames to state events

* Center state events and make them less tiny
Diffstat (limited to 'resources/qml/TimelineRow.qml')
-rw-r--r--resources/qml/TimelineRow.qml11
1 files changed, 6 insertions, 5 deletions
diff --git a/resources/qml/TimelineRow.qml b/resources/qml/TimelineRow.qml
index 0ff33bf8..02a9579b 100644
--- a/resources/qml/TimelineRow.qml
+++ b/resources/qml/TimelineRow.qml
@@ -53,7 +53,7 @@ Item {
     Rectangle {
         color: (Settings.messageHoverHighlight && hovered) ? Nheko.colors.alternateBase : "transparent"
         anchors.fill: parent
-        anchors.leftMargin: Settings.smallAvatars? 0 : Nheko.avatarSize+8
+        // this looks better without margins
     }
 
     TapHandler {
@@ -72,10 +72,11 @@ Item {
         id: row
         property bool bubbleOnRight : isSender && Settings.bubbles
         property int bubblePadding: (parent.width-(Settings.smallAvatars? 0 : Nheko.avatarSize+8))/10
-        anchors.rightMargin: isSender || !Settings.bubbles? 0 : bubblePadding
-        anchors.leftMargin: (Settings.smallAvatars? 0 : Nheko.avatarSize+8) + (bubbleOnRight? bubblePadding : 0) // align bubble with section header
-        anchors.left: bubbleOnRight? undefined : parent.left
-        anchors.right: bubbleOnRight? parent.right : undefined
+        anchors.rightMargin: isStateEvent? 0 : (isSender || !Settings.bubbles? 0 : bubblePadding)
+        anchors.leftMargin: isStateEvent? 0 :((Settings.smallAvatars? 0 : Nheko.avatarSize+8) + (bubbleOnRight? bubblePadding : 0)) // align bubble with section header
+        anchors.left: isStateEvent? undefined : (bubbleOnRight? undefined : parent.left)
+        anchors.right: isStateEvent? undefined: (bubbleOnRight? parent.right : undefined)
+        anchors.horizontalCenter: isStateEvent? parent.horizontalCenter : undefined
         property int maxWidth: parent.width-anchors.leftMargin-anchors.rightMargin
         width: Settings.bubbles? Math.min(maxWidth,implicitWidth+metadata.width+12) : maxWidth
         leftPadding: 4