diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 3bbaa020..a5520031 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -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) {
diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index 49209f68..e31321f9 100644
--- a/resources/qml/delegates/MessageDelegate.qml
+++ b/resources/qml/delegates/MessageDelegate.qml
@@ -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 {}
diff --git a/resources/qml/delegates/Redacted.qml b/resources/qml/delegates/Pill.qml
similarity index 91%
rename from resources/qml/delegates/Redacted.qml
rename to resources/qml/delegates/Pill.qml
index 42fb4835..53a9684e 100644
--- a/resources/qml/delegates/Redacted.qml
+++ b/resources/qml/delegates/Pill.qml
@@ -2,7 +2,6 @@ import QtQuick 2.5
import QtQuick.Controls 2.1
Label {
- text: qsTr("redacted")
color: inactiveColors.text
horizontalAlignment: Text.AlignHCenter
diff --git a/resources/qml/delegates/PlayableMediaMessage.qml b/resources/qml/delegates/PlayableMediaMessage.qml
index 68b09f7b..1207ac77 100644
--- a/resources/qml/delegates/PlayableMediaMessage.qml
+++ b/resources/qml/delegates/PlayableMediaMessage.qml
@@ -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
diff --git a/resources/res.qrc b/resources/res.qrc
index c9938d57..53406c48 100644
--- a/resources/res.qrc
+++ b/resources/res.qrc
@@ -128,7 +128,7 @@
qml/delegates/ImageMessage.qml
qml/delegates/PlayableMediaMessage.qml
qml/delegates/FileMessage.qml
- qml/delegates/Redacted.qml
+ qml/delegates/Pill.qml
qml/delegates/Placeholder.qml
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 11344e60..b904dfd7 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -320,7 +320,10 @@ eventPropHeight(const mtx::events::RoomEvent &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.;
}
}