diff options
author | tastytea <tastytea@tastytea.de> | 2022-01-12 23:52:32 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-02-10 00:48:35 +0100 |
commit | f7ca41bc498a8c5685a7ffd9733a5ba8bc94d797 (patch) | |
tree | becedfe208b1b42787e6e78c773d7918eccc4e56 /resources | |
parent | Hidden events: Incorporate suggestions from review (diff) | |
download | nheko-f7ca41bc498a8c5685a7ffd9733a5ba8bc94d797.tar.xz |
Hidden events: Change title and prompt depending on isRoomSetting
We would have to set text and title separately otherwise.
Diffstat (limited to 'resources')
-rw-r--r-- | resources/qml/dialogs/HiddenEventsDialog.qml | 19 | ||||
-rw-r--r-- | resources/qml/dialogs/RoomSettings.qml | 2 |
2 files changed, 18 insertions, 3 deletions
diff --git a/resources/qml/dialogs/HiddenEventsDialog.qml b/resources/qml/dialogs/HiddenEventsDialog.qml index f6fc830d..004c8d30 100644 --- a/resources/qml/dialogs/HiddenEventsDialog.qml +++ b/resources/qml/dialogs/HiddenEventsDialog.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 diff --git a/resources/qml/dialogs/RoomSettings.qml b/resources/qml/dialogs/RoomSettings.qml index 00743a20..8af11b44 100644 --- a/resources/qml/dialogs/RoomSettings.qml +++ b/resources/qml/dialogs/RoomSettings.qml @@ -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 { |