summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-08-17 23:31:25 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-08-17 23:31:25 +0200
commit5b460861b126a49f1e186c8b59ffb0faf0109aab (patch)
tree1dab81bfa63dac47608430b34163f7df51194c8a /resources
parentLoad message list async (diff)
downloadnheko-5b460861b126a49f1e186c8b59ffb0faf0109aab.tar.xz
Allow accepting knocks in the timeline
As well as selecting more join rules.
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/Avatar.qml2
-rw-r--r--resources/qml/RoomList.qml9
-rw-r--r--resources/qml/RoomSettings.qml11
-rw-r--r--resources/qml/delegates/MessageDelegate.qml24
4 files changed, 35 insertions, 11 deletions
diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml

index 4a9a565c..ab067eee 100644 --- a/resources/qml/Avatar.qml +++ b/resources/qml/Avatar.qml
@@ -49,7 +49,7 @@ Rectangle { smooth: true sourceSize.width: avatar.width sourceSize.height: avatar.height - source: avatar.url ? (avatar.url + "?radius=" + (Settings.avatarCircles ? 100.0 : 25.0) + ((avatar.crop) ? "" : "&scale")) : "" + source: avatar.url ? (avatar.url + "?radius=" + (Settings.avatarCircles ? 100 : 25) + ((avatar.crop) ? "" : "&scale")) : "" MouseArea { id: mouseArea diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml
index b84b4c36..a0009174 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml
@@ -16,12 +16,13 @@ Page { property int avatarSize: Math.ceil(fontMetrics.lineSpacing * 2.3) property bool collapsed: false -Component { + Component { id: roomDirectoryComponent RoomDirectory { } - } + + } ListView { id: roomlist @@ -570,10 +571,10 @@ Component { ToolTip.visible: hovered ToolTip.text: qsTr("Room directory") Layout.margins: Nheko.paddingMedium - onClicked: { + onClicked: { var win = roomDirectoryComponent.createObject(timelineRoot); win.show(); - } + } } ImageButton { diff --git a/resources/qml/RoomSettings.qml b/resources/qml/RoomSettings.qml
index 491a336f..92cd431a 100644 --- a/resources/qml/RoomSettings.qml +++ b/resources/qml/RoomSettings.qml
@@ -186,7 +186,16 @@ ApplicationWindow { ComboBox { enabled: roomSettings.canChangeJoinRules - model: [qsTr("Anyone and guests"), qsTr("Anyone"), qsTr("Invited users")] + model: { + let opts = [qsTr("Anyone and guests"), qsTr("Anyone"), qsTr("Invited users")]; + if (roomSettings.supportsKnocking) + opts.push(qsTr("By knocking")); + + if (roomSettings.supportsRestricted) + opts.push(qsTr("Restricted by membership in other rooms")); + + return opts; + } currentIndex: roomSettings.accessJoinRules onActivated: { roomSettings.changeAccessRules(index); diff --git a/resources/qml/delegates/MessageDelegate.qml b/resources/qml/delegates/MessageDelegate.qml
index a8bdf183..893edc77 100644 --- a/resources/qml/delegates/MessageDelegate.qml +++ b/resources/qml/delegates/MessageDelegate.qml
@@ -3,6 +3,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later import QtQuick 2.6 +import QtQuick.Controls 2.1 +import QtQuick.Layouts 1.2 import im.nheko 1.0 Item { @@ -357,11 +359,23 @@ Item { DelegateChoice { roleValue: MtxEvent.Member - NoticeMessage { - body: formatted - isOnlyEmoji: false - isReply: d.isReply - formatted: d.relatedEventCacheBuster, room.formatMemberEvent(d.eventId) + ColumnLayout { + width: parent ? parent.width : undefined + + NoticeMessage { + body: formatted + isOnlyEmoji: false + isReply: d.isReply + formatted: d.relatedEventCacheBuster, room.formatMemberEvent(d.eventId) + } + + Button { + visible: d.relatedEventCacheBuster, room.showAcceptKnockButton(d.eventId) + palette: Nheko.colors + text: qsTr("Allow them in") + onClicked: room.acceptKnock(eventId) + } + } }