EventFile: be as tall as the message avatars

This commit is contained in:
miruka 2019-12-16 18:28:51 -04:00
parent 1d43d522e6
commit b3e3fd7bc6
3 changed files with 9 additions and 6 deletions

11
TODO.md
View File

@ -1,8 +1,5 @@
# TODO # TODO
- some way to show name and date on EventFile
- sentinel func to report path if already cached without having to click
- verify eventfile height
- Make dark bar extend down pane - Make dark bar extend down pane
- Verify default size - Verify default size
@ -13,12 +10,15 @@
- Send the monitor PR - Send the monitor PR
- nio ClientTimeout - nio ClientTimeout
- clicking on encrypted images opens the thumbnail
- Handle set avatar upload errors - Handle set avatar upload errors
- Support encrypted m.file
- Confirmation box after picking file to upload - Confirmation box after picking file to upload
- Show real progression for mxc thumbnail loadings - Show real progression for mxc thumbnail loadings
- Some way to show name and date on EventFile
- Sentinel function to report download file path if already cached,
without having to click & try downloading first
- EventFile download UI & Save as... in context menu
- Show reason under broken thumbnail icons - Show reason under broken thumbnail icons
- Support m.file thumbnails - Support m.file thumbnails
- Generate video thumbnails - Generate video thumbnails
@ -30,7 +30,6 @@
- Audio: online playback is buggy, must download+play file - Audio: online playback is buggy, must download+play file
- EventLink - EventLink
- Special treatment for matrix.to URLs? - Special treatment for matrix.to URLs?
- EventFile & Downloading (right click on media > save as...)
- Prevent using upload keybinds in rooms with no perms - Prevent using upload keybinds in rooms with no perms
## Refactoring ## Refactoring

View File

@ -41,6 +41,7 @@ HButton {
verticalAlignment: Qt.AlignVCenter verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
} }
HRowLayout { HRowLayout {
@ -54,6 +55,7 @@ HButton {
color: theme.colors.halfDimText color: theme.colors.halfDimText
visible: Layout.maximumWidth > 0 visible: Layout.maximumWidth > 0
Layout.fillHeight: true
Layout.maximumWidth: Layout.maximumWidth:
text && tile.width >= 160 * theme.uiScale ? text && tile.width >= 160 * theme.uiScale ?
implicitWidth : 0 implicitWidth : 0
@ -72,6 +74,7 @@ HButton {
visible: Layout.maximumHeight > 0 visible: Layout.maximumHeight > 0
Layout.maximumHeight: text ? implicitWidth : 0 Layout.maximumHeight: text ? implicitWidth : 0
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true
Behavior on Layout.maximumHeight { HNumberAnimation {} } Behavior on Layout.maximumHeight { HNumberAnimation {} }
} }

View File

@ -10,6 +10,7 @@ HTile {
theme.chat.message.fileMinWidth), theme.chat.message.fileMinWidth),
Math.min(eventContent.messageBodyWidth, implicitWidth), Math.min(eventContent.messageBodyWidth, implicitWidth),
) )
height: Math.max(theme.chat.message.avatarSize, implicitHeight)
title.text: loader.singleMediaInfo.media_title || qsTr("Untitled file") title.text: loader.singleMediaInfo.media_title || qsTr("Untitled file")
title.elide: Text.ElideMiddle title.elide: Text.ElideMiddle