Hidden events: Change title and prompt depending on isRoomSetting

We would have to set text and title separately otherwise.
pull/891/head
tastytea 3 years ago committed by Nicolas Werner
parent f0bb64030e
commit f7ca41bc49
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 19
      resources/qml/dialogs/HiddenEventsDialog.qml
  2. 2
      resources/qml/dialogs/RoomSettings.qml

@ -11,7 +11,7 @@ import im.nheko 1.0
ApplicationWindow {
id: hiddenEventsDialog
property alias prompt: promptLabel.text
property var isRoomSetting: false
property var onAccepted: undefined
modality: Qt.NonModal
@ -19,7 +19,14 @@ ApplicationWindow {
minimumWidth: 250
minimumHeight: 220
Component.onCompleted: Nheko.reparent(hiddenEventsDialog)
title: qsTr("Hidden events settings for %1").arg(roomSettings.roomName)
title: {
if (isRoomSetting) {
return qsTr("Hidden events for %1").arg(roomSettings.roomName);
}
else {
return qsTr("Hidden events");
}
}
Shortcut {
sequence: StandardKey.Cancel
@ -33,6 +40,14 @@ ApplicationWindow {
MatrixText {
id: promptLabel
text: {
if (isRoomSetting) {
return qsTr("These events will be be <b>shown</b> in %1:").arg(roomSettings.roomName);
}
else {
return qsTr("These events will be be <b>shown</b>:");
}
}
font.pixelSize: Math.floor(fontMetrics.font.pixelSize * 1.2)
Layout.fillWidth: true
Layout.fillHeight: false

@ -260,7 +260,7 @@ ApplicationWindow {
HiddenEventsDialog {
id: hiddenEventsDialog
prompt: qsTr("These events will be be <b>shown</b> in %1:").arg(roomSettings.roomName)
isRoomSetting: true
}
Button {

Loading…
Cancel
Save