Fix implicitheight error.

This commit is contained in:
Black Hat 2019-05-06 09:31:57 +08:00
parent ef469ee347
commit f8f10bb55d
2 changed files with 26 additions and 16 deletions

View File

@ -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 || ""
padding: 0
background: RippleEffect {
anchors.fill: parent
onPrimaryClicked: goToEvent(replyEventId)
}
contentItem: RowLayout {
spacing: 8
visible: replyVisible
Avatar {
Layout.preferredWidth: 28
Layout.preferredHeight: 28
Layout.alignment: Qt.AlignTop
source: replyAuthor ? replyAuthor.avatarMediaId : ""
hint: replyAuthor ? replyAuthor.displayName : "H"
source: replyVisible ? replyAuthor.avatarMediaId : ""
hint: replyVisible ? replyAuthor.displayName : "H"
RippleEffect {
anchors.fill: parent
onClicked: userDetailDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom, "user": replyAuthor}).open()
}
}
Label {
Control {
Layout.fillWidth: true
padding: 4
background: RippleEffect {
onClicked: goToEvent(replyEventId)
}
contentItem: Label {
Layout.fillWidth: true
visible: replyVisible
color: "white"
text: "<style>a{color: white;} .user-pill{}</style>" + (replyDisplay || "")
@ -172,7 +177,7 @@ ColumnLayout {
Layout.fillWidth: true
Layout.preferredHeight: 1
visible: replyEventId || ""
visible: replyVisible
color: "white"
}

View File

@ -256,6 +256,11 @@ Item {
}
}
}
DelegateChoice {
roleValue: "other"
delegate: Item {}
}
}
Button {