From f8f10bb55d67d5f28445b9793f60f86567e33647 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Mon, 6 May 2019 09:31:57 +0800 Subject: [PATCH] Fix implicitheight error. --- .../Component/Timeline/MessageDelegate.qml | 37 +++++++++++-------- imports/Spectral/Panel/RoomPanel.qml | 5 +++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/imports/Spectral/Component/Timeline/MessageDelegate.qml b/imports/Spectral/Component/Timeline/MessageDelegate.qml index f6346c4..6a4e2b5 100644 --- a/imports/Spectral/Component/Timeline/MessageDelegate.qml +++ b/imports/Spectral/Component/Timeline/MessageDelegate.qml @@ -14,6 +14,7 @@ import Spectral.Effect 2.0 ColumnLayout { readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other") readonly property bool sentByMe: author === currentRoom.localUser + property bool replyVisible: replyEventId || "" signal saveFileAs() signal openExternally() @@ -131,34 +132,38 @@ ColumnLayout { } contentItem: ColumnLayout { - Control { + RowLayout { Layout.fillWidth: true - visible: replyEventId || "" + visible: replyVisible - padding: 0 + Avatar { + Layout.preferredWidth: 28 + Layout.preferredHeight: 28 - background: RippleEffect { - anchors.fill: parent + source: replyVisible ? replyAuthor.avatarMediaId : "" + hint: replyVisible ? replyAuthor.displayName : "H" - onPrimaryClicked: goToEvent(replyEventId) + RippleEffect { + anchors.fill: parent + + onClicked: userDetailDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom, "user": replyAuthor}).open() + } } - contentItem: RowLayout { - spacing: 8 + Control { + Layout.fillWidth: true - Avatar { - Layout.preferredWidth: 28 - Layout.preferredHeight: 28 - Layout.alignment: Qt.AlignTop + padding: 4 - source: replyAuthor ? replyAuthor.avatarMediaId : "" - hint: replyAuthor ? replyAuthor.displayName : "H" + background: RippleEffect { + onClicked: goToEvent(replyEventId) } - Label { + contentItem: Label { Layout.fillWidth: true + visible: replyVisible color: "white" text: "" + (replyDisplay || "") @@ -172,7 +177,7 @@ ColumnLayout { Layout.fillWidth: true Layout.preferredHeight: 1 - visible: replyEventId || "" + visible: replyVisible color: "white" } diff --git a/imports/Spectral/Panel/RoomPanel.qml b/imports/Spectral/Panel/RoomPanel.qml index b44dfeb..0176e5c 100644 --- a/imports/Spectral/Panel/RoomPanel.qml +++ b/imports/Spectral/Panel/RoomPanel.qml @@ -256,6 +256,11 @@ Item { } } } + + DelegateChoice { + roleValue: "other" + delegate: Item {} + } } Button {