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 { ColumnLayout {
readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other") readonly property bool avatarVisible: !sentByMe && (aboveAuthor !== author || aboveSection !== section || aboveEventType === "state" || aboveEventType === "emote" || aboveEventType === "other")
readonly property bool sentByMe: author === currentRoom.localUser readonly property bool sentByMe: author === currentRoom.localUser
property bool replyVisible: replyEventId || ""
signal saveFileAs() signal saveFileAs()
signal openExternally() signal openExternally()
@ -131,34 +132,38 @@ ColumnLayout {
} }
contentItem: ColumnLayout { contentItem: ColumnLayout {
Control { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
visible: replyEventId || "" visible: replyVisible
padding: 0
background: RippleEffect {
anchors.fill: parent
onPrimaryClicked: goToEvent(replyEventId)
}
contentItem: RowLayout {
spacing: 8
Avatar { Avatar {
Layout.preferredWidth: 28 Layout.preferredWidth: 28
Layout.preferredHeight: 28 Layout.preferredHeight: 28
Layout.alignment: Qt.AlignTop
source: replyAuthor ? replyAuthor.avatarMediaId : "" source: replyVisible ? replyAuthor.avatarMediaId : ""
hint: replyAuthor ? replyAuthor.displayName : "H" hint: replyVisible ? replyAuthor.displayName : "H"
RippleEffect {
anchors.fill: parent
onClicked: userDetailDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom, "user": replyAuthor}).open()
}
} }
Label { Control {
Layout.fillWidth: true Layout.fillWidth: true
padding: 4
background: RippleEffect {
onClicked: goToEvent(replyEventId)
}
contentItem: Label {
Layout.fillWidth: true
visible: replyVisible
color: "white" color: "white"
text: "<style>a{color: white;} .user-pill{}</style>" + (replyDisplay || "") text: "<style>a{color: white;} .user-pill{}</style>" + (replyDisplay || "")
@ -172,7 +177,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 1 Layout.preferredHeight: 1
visible: replyEventId || "" visible: replyVisible
color: "white" color: "white"
} }

View File

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