mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
place own bubbles on right and remove user info
This commit is contained in:
parent
d0ac110cb7
commit
894438c6ce
3 changed files with 16 additions and 14 deletions
|
@ -249,8 +249,8 @@ ScrollView {
|
||||||
id: sectionHeader
|
id: sectionHeader
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
topPadding: 4
|
topPadding: 0
|
||||||
bottomPadding: 4
|
bottomPadding: 0
|
||||||
spacing: 8
|
spacing: 8
|
||||||
visible: (previousMessageUserId !== userId || previousMessageDay !== day || isStateEvent !== previousMessageIsStateEvent)
|
visible: (previousMessageUserId !== userId || previousMessageDay !== day || isStateEvent !== previousMessageIsStateEvent)
|
||||||
width: parentWidth
|
width: parentWidth
|
||||||
|
@ -278,13 +278,13 @@ ScrollView {
|
||||||
Row {
|
Row {
|
||||||
height: userName_.height
|
height: userName_.height
|
||||||
spacing: 8
|
spacing: 8
|
||||||
visible: !isStateEvent
|
visible: !isStateEvent && (!isSender || !Settings.bubbles)
|
||||||
|
|
||||||
Avatar {
|
Avatar {
|
||||||
id: messageUserAvatar
|
id: messageUserAvatar
|
||||||
|
|
||||||
width: Nheko.avatarSize
|
width: Nheko.avatarSize * (Settings.bubbles? 0.5 : 1)
|
||||||
height: Nheko.avatarSize
|
height: Nheko.avatarSize * (Settings.bubbles? 0.5 : 1)
|
||||||
url: !room ? "" : room.avatarUrl(userId).replace("mxc://", "image://MxcImage/")
|
url: !room ? "" : room.avatarUrl(userId).replace("mxc://", "image://MxcImage/")
|
||||||
displayName: userName
|
displayName: userName
|
||||||
userid: userId
|
userid: userId
|
||||||
|
@ -460,6 +460,7 @@ ScrollView {
|
||||||
property string previousMessageDay: wrapper.previousMessageDay
|
property string previousMessageDay: wrapper.previousMessageDay
|
||||||
property bool previousMessageIsStateEvent: wrapper.previousMessageIsStateEvent
|
property bool previousMessageIsStateEvent: wrapper.previousMessageIsStateEvent
|
||||||
property bool isStateEvent: wrapper.isStateEvent
|
property bool isStateEvent: wrapper.isStateEvent
|
||||||
|
property bool isSender: wrapper.isSender
|
||||||
property string userName: wrapper.userName
|
property string userName: wrapper.userName
|
||||||
property date timestamp: wrapper.timestamp
|
property date timestamp: wrapper.timestamp
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,8 @@ Item {
|
||||||
required property int status
|
required property int status
|
||||||
required property int relatedEventCacheBuster
|
required property int relatedEventCacheBuster
|
||||||
|
|
||||||
anchors.left: parent.left
|
width: parent.width
|
||||||
anchors.right: parent.right
|
height: childrenRect.height
|
||||||
height: row.height+reactionRow.height
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: (Settings.messageHoverHighlight && hoverHandler.hovered) ? Nheko.colors.alternateBase : "transparent"
|
color: (Settings.messageHoverHighlight && hoverHandler.hovered) ? Nheko.colors.alternateBase : "transparent"
|
||||||
|
@ -74,13 +73,14 @@ Item {
|
||||||
|
|
||||||
Control {
|
Control {
|
||||||
id: row
|
id: row
|
||||||
|
property bool bubbleOnRight : isSender && Settings.bubbles
|
||||||
anchors.rightMargin: 1
|
anchors.rightMargin: isSender || !Settings.bubbles? 0 : parent.width/8
|
||||||
anchors.leftMargin: Nheko.avatarSize + 12 // align bubble with section header
|
anchors.leftMargin: (Settings.bubbles? 0 : Nheko.avatarSize) + (bubbleOnRight? parent.width/8 : 8) // align bubble with section header
|
||||||
anchors.left: parent.left
|
anchors.left: bubbleOnRight? undefined : parent.left
|
||||||
|
anchors.right: bubbleOnRight? parent.right : undefined
|
||||||
property int maxWidth: parent.width-anchors.leftMargin-anchors.rightMargin
|
property int maxWidth: parent.width-anchors.leftMargin-anchors.rightMargin
|
||||||
width: Settings.bubbles? Math.min(maxWidth,implicitWidth+metadata.width) : maxWidth
|
width: Settings.bubbles? Math.min(maxWidth,implicitWidth+metadata.width) : maxWidth
|
||||||
padding: isStateEvent? 0 : 3
|
padding: isStateEvent? 0 : 2
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
property color userColor: TimelineManager.userColor(userId, Nheko.colors.base)
|
property color userColor: TimelineManager.userColor(userId, Nheko.colors.base)
|
||||||
property color bgColor: Nheko.colors.base
|
property color bgColor: Nheko.colors.base
|
||||||
|
@ -237,6 +237,7 @@ Item {
|
||||||
Reactions {
|
Reactions {
|
||||||
anchors {
|
anchors {
|
||||||
top: row.bottom
|
top: row.bottom
|
||||||
|
topMargin: -2
|
||||||
left: parent.left
|
left: parent.left
|
||||||
leftMargin: Nheko.avatarSize + 16
|
leftMargin: Nheko.avatarSize + 16
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ Rectangle {
|
||||||
required property string eventId
|
required property string eventId
|
||||||
|
|
||||||
radius: fontMetrics.lineSpacing / 2 + Nheko.paddingMedium
|
radius: fontMetrics.lineSpacing / 2 + Nheko.paddingMedium
|
||||||
width: parent.width
|
width: parent.width? parent.width : 0
|
||||||
implicitWidth: encryptedText.implicitWidth+24+Nheko.paddingMedium*3 // Column doesn't provide a useful implicitWidth, should be replaced by ColumnLayout
|
implicitWidth: encryptedText.implicitWidth+24+Nheko.paddingMedium*3 // Column doesn't provide a useful implicitWidth, should be replaced by ColumnLayout
|
||||||
height: contents.implicitHeight + Nheko.paddingMedium * 2
|
height: contents.implicitHeight + Nheko.paddingMedium * 2
|
||||||
color: Nheko.colors.alternateBase
|
color: Nheko.colors.alternateBase
|
||||||
|
|
Loading…
Reference in a new issue