Show encryption enabled and use a non zero size for zero size vide

This commit is contained in:
Nicolas Werner 2019-11-22 17:08:32 +01:00
parent 85aae9408b
commit 9fd279c020
6 changed files with 16 additions and 6 deletions

View File

@ -79,7 +79,7 @@ Item {
}
}
onAtYBeginningChanged: if (atYBeginning) model.fetchHistory()
onAtYBeginningChanged: if (atYBeginning) { chat.model.currentIndex = 0; chat.currentIndex = 0; model.fetchHistory(); }
function updatePosition() {
for (var y = chat.contentY + chat.height; y > chat.height; y -= 9) {

View File

@ -39,7 +39,15 @@ DelegateChooser {
}
DelegateChoice {
roleValue: MtxEvent.Redacted
Redacted {}
Pill {
text: qsTr("redacted")
}
}
DelegateChoice {
roleValue: MtxEvent.Encryption
Pill {
text: qsTr("Encryption enabled")
}
}
DelegateChoice {
Placeholder {}

View File

@ -2,7 +2,6 @@ import QtQuick 2.5
import QtQuick.Controls 2.1
Label {
text: qsTr("redacted")
color: inactiveColors.text
horizontalAlignment: Text.AlignHCenter

View File

@ -20,7 +20,7 @@ Rectangle {
Rectangle {
id: videoContainer
visible: model.type == MtxEvent.VideoMessage
width: Math.min(parent.width, model.width)
width: Math.min(parent.width, model.width ? model.width : 400) // some media has 0 as size...
height: width*model.proportionalHeight
Image {
anchors.fill: parent

View File

@ -128,7 +128,7 @@
<file>qml/delegates/ImageMessage.qml</file>
<file>qml/delegates/PlayableMediaMessage.qml</file>
<file>qml/delegates/FileMessage.qml</file>
<file>qml/delegates/Redacted.qml</file>
<file>qml/delegates/Pill.qml</file>
<file>qml/delegates/Placeholder.qml</file>
</qresource>
</RCC>

View File

@ -320,7 +320,10 @@ eventPropHeight(const mtx::events::RoomEvent<T> &e)
auto w = eventWidth(e);
if (w == 0)
w = 1;
return eventHeight(e) / (double)w;
double prop = eventHeight(e) / (double)w;
return prop > 0 ? prop : 1.;
}
}