diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index 3bbaa02..a552003 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 49209f6..e31321f 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 42fb483..53a9684 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 68b09f7..1207ac7 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 c9938d5..53406c4 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 11344e6..b904dfd 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.;
}
}