mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Show encryption enabled and use a non zero size for zero size vide
This commit is contained in:
parent
85aae9408b
commit
9fd279c020
6 changed files with 16 additions and 6 deletions
|
@ -79,7 +79,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onAtYBeginningChanged: if (atYBeginning) model.fetchHistory()
|
onAtYBeginningChanged: if (atYBeginning) { chat.model.currentIndex = 0; chat.currentIndex = 0; model.fetchHistory(); }
|
||||||
|
|
||||||
function updatePosition() {
|
function updatePosition() {
|
||||||
for (var y = chat.contentY + chat.height; y > chat.height; y -= 9) {
|
for (var y = chat.contentY + chat.height; y > chat.height; y -= 9) {
|
||||||
|
|
|
@ -39,7 +39,15 @@ DelegateChooser {
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
roleValue: MtxEvent.Redacted
|
roleValue: MtxEvent.Redacted
|
||||||
Redacted {}
|
Pill {
|
||||||
|
text: qsTr("redacted")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DelegateChoice {
|
||||||
|
roleValue: MtxEvent.Encryption
|
||||||
|
Pill {
|
||||||
|
text: qsTr("Encryption enabled")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
DelegateChoice {
|
DelegateChoice {
|
||||||
Placeholder {}
|
Placeholder {}
|
||||||
|
|
|
@ -2,7 +2,6 @@ import QtQuick 2.5
|
||||||
import QtQuick.Controls 2.1
|
import QtQuick.Controls 2.1
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
text: qsTr("redacted")
|
|
||||||
color: inactiveColors.text
|
color: inactiveColors.text
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
|
@ -20,7 +20,7 @@ Rectangle {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: videoContainer
|
id: videoContainer
|
||||||
visible: model.type == MtxEvent.VideoMessage
|
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
|
height: width*model.proportionalHeight
|
||||||
Image {
|
Image {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
<file>qml/delegates/ImageMessage.qml</file>
|
<file>qml/delegates/ImageMessage.qml</file>
|
||||||
<file>qml/delegates/PlayableMediaMessage.qml</file>
|
<file>qml/delegates/PlayableMediaMessage.qml</file>
|
||||||
<file>qml/delegates/FileMessage.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>
|
<file>qml/delegates/Placeholder.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -320,7 +320,10 @@ eventPropHeight(const mtx::events::RoomEvent<T> &e)
|
||||||
auto w = eventWidth(e);
|
auto w = eventWidth(e);
|
||||||
if (w == 0)
|
if (w == 0)
|
||||||
w = 1;
|
w = 1;
|
||||||
return eventHeight(e) / (double)w;
|
|
||||||
|
double prop = eventHeight(e) / (double)w;
|
||||||
|
|
||||||
|
return prop > 0 ? prop : 1.;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue