Merge pull request #301 from kamathmanu/issue266-filenameOnHover

Display filename on mouse hover
master
DeepBlueV7.X 4 years ago committed by GitHub
commit b23913fa7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 29
      resources/qml/delegates/ImageMessage.qml

@ -31,11 +31,40 @@ Item {
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
MouseArea { MouseArea {
id: mouseArea
enabled: model.data.type == MtxEvent.ImageMessage && img.status == Image.Ready enabled: model.data.type == MtxEvent.ImageMessage && img.status == Image.Ready
hoverEnabled: true
anchors.fill: parent anchors.fill: parent
onClicked: TimelineManager.openImageOverlay(model.data.url, model.data.id) onClicked: TimelineManager.openImageOverlay(model.data.url, model.data.id)
} }
Item {
id: overlay
anchors.fill: parent
visible: mouseArea.containsMouse
Rectangle {
id: container
width: parent.width
implicitHeight: imgcaption.implicitHeight
anchors.bottom: overlay.bottom
color: colors.window
opacity: 0.75
} }
Text {
id: imgcaption
anchors.fill: container
elide: Text.ElideMiddle
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
// See this MSC: https://github.com/matrix-org/matrix-doc/pull/2530
text: model.data.filename ? model.data.filename : model.data.body
color: colors.text
}
}
}
} }

Loading…
Cancel
Save