2023-02-22 01:48:49 +03:00
|
|
|
// SPDX-FileCopyrightText: Nheko Contributors
|
2021-03-07 07:57:56 +03:00
|
|
|
//
|
2021-03-05 02:35:15 +03:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-03-15 00:22:52 +03:00
|
|
|
import Qt.labs.platform 1.1 as Platform
|
2021-11-11 06:29:50 +03:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
2021-01-12 17:03:39 +03:00
|
|
|
import QtQuick.Layouts 1.2
|
2021-12-13 21:09:03 +03:00
|
|
|
import QtQuick.Window 2.15
|
2020-10-26 16:57:54 +03:00
|
|
|
import im.nheko 1.0
|
|
|
|
|
2021-12-11 08:10:41 +03:00
|
|
|
import "./delegates"
|
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
Pane {
|
2020-10-26 16:57:54 +03:00
|
|
|
id: topBar
|
|
|
|
|
2021-06-08 23:18:51 +03:00
|
|
|
property bool showBackButton: false
|
2021-07-09 10:36:33 +03:00
|
|
|
property string roomName: room ? room.roomName : qsTr("No room selected")
|
2021-09-08 03:38:39 +03:00
|
|
|
property string roomId: room ? room.roomId : ""
|
2021-07-09 10:36:33 +03:00
|
|
|
property string avatarUrl: room ? room.roomAvatarUrl : ""
|
|
|
|
property string roomTopic: room ? room.roomTopic : ""
|
2021-08-14 00:13:09 +03:00
|
|
|
property bool isEncrypted: room ? room.isEncrypted : false
|
|
|
|
property int trustlevel: room ? room.trustlevel : Crypto.Unverified
|
2021-09-08 03:38:39 +03:00
|
|
|
property bool isDirect: room ? room.isDirect : false
|
|
|
|
property string directChatOtherUserId: room ? room.directChatOtherUserId : ""
|
2021-06-08 23:18:51 +03:00
|
|
|
|
2022-12-13 20:09:34 +03:00
|
|
|
property bool searchHasFocus: searchField.focus && searchField.enabled
|
|
|
|
|
2022-10-06 22:59:59 +03:00
|
|
|
property string searchString: ""
|
|
|
|
|
2023-01-23 15:15:43 +03:00
|
|
|
// HACK: https://bugreports.qt.io/browse/QTBUG-83972, qtwayland cannot auto hide menu
|
|
|
|
Connections {
|
|
|
|
function onHideMenu() {
|
|
|
|
roomOptionsMenu.close()
|
|
|
|
}
|
|
|
|
target: MainWindow
|
|
|
|
}
|
|
|
|
|
2022-10-06 22:59:59 +03:00
|
|
|
onRoomIdChanged: {
|
|
|
|
searchString = "";
|
|
|
|
searchButton.searchActive = false;
|
|
|
|
searchField.text = ""
|
|
|
|
}
|
|
|
|
|
2022-10-07 11:04:08 +03:00
|
|
|
Shortcut {
|
|
|
|
sequence: StandardKey.Find
|
|
|
|
onActivated: searchButton.searchActive = !searchButton.searchActive
|
|
|
|
}
|
|
|
|
|
2020-10-26 16:57:54 +03:00
|
|
|
Layout.fillWidth: true
|
2021-05-15 00:35:34 +03:00
|
|
|
implicitHeight: topLayout.height + Nheko.paddingMedium * 2
|
2020-10-26 16:57:54 +03:00
|
|
|
z: 3
|
2022-01-30 22:09:58 +03:00
|
|
|
|
|
|
|
padding: 0
|
|
|
|
background: Rectangle {
|
|
|
|
color: Nheko.colors.window
|
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
|
2021-03-15 00:22:52 +03:00
|
|
|
TapHandler {
|
2021-04-11 23:24:39 +03:00
|
|
|
onSingleTapped: {
|
2022-02-04 20:47:17 +03:00
|
|
|
if (eventPoint.position.y > topBar.height - (pinnedMessages.visible ? pinnedMessages.height : 0) - (widgets.visible ? widgets.height : 0)) {
|
2021-12-11 08:10:41 +03:00
|
|
|
eventPoint.accepted = true
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (showBackButton && eventPoint.position.x < Nheko.paddingMedium + backToRoomsButton.width) {
|
|
|
|
eventPoint.accepted = true
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (eventPoint.position.x > topBar.width - Nheko.paddingMedium - roomOptionsButton.width) {
|
|
|
|
eventPoint.accepted = true
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-09-20 22:26:28 +03:00
|
|
|
if (communityLabel.visible && eventPoint.position.y < communityAvatar.height + Nheko.paddingMedium + Nheko.paddingSmall/2) {
|
|
|
|
if (!Communities.trySwitchToSpace(room.parentSpace.roomid))
|
|
|
|
room.parentSpace.promptJoin();
|
|
|
|
eventPoint.accepted = true
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-11-11 06:29:50 +03:00
|
|
|
if (room) {
|
|
|
|
let p = topBar.mapToItem(roomTopicC, eventPoint.position.x, eventPoint.position.y);
|
|
|
|
let link = roomTopicC.linkAt(p.x, p.y);
|
|
|
|
|
|
|
|
if (link) {
|
|
|
|
Nheko.openLink(link);
|
|
|
|
} else {
|
|
|
|
TimelineManager.openRoomSettings(room.roomId);
|
|
|
|
}
|
|
|
|
}
|
2021-07-09 10:36:33 +03:00
|
|
|
|
2021-04-11 23:24:39 +03:00
|
|
|
eventPoint.accepted = true;
|
|
|
|
}
|
|
|
|
gesturePolicy: TapHandler.ReleaseWithinBounds
|
2020-10-26 16:57:54 +03:00
|
|
|
}
|
|
|
|
|
2021-11-11 06:29:50 +03:00
|
|
|
HoverHandler {
|
|
|
|
grabPermissions: PointerHandler.TakeOverForbidden | PointerHandler.CanTakeOverFromAnything
|
|
|
|
}
|
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
contentItem: Item {
|
|
|
|
GridLayout {
|
|
|
|
id: topLayout
|
|
|
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.margins: Nheko.paddingMedium
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
columnSpacing: Nheko.paddingSmall
|
|
|
|
rowSpacing: Nheko.paddingSmall
|
|
|
|
|
2022-09-20 22:26:28 +03:00
|
|
|
|
|
|
|
Avatar {
|
|
|
|
id: communityAvatar
|
|
|
|
|
|
|
|
visible: roomid && room.parentSpace.isLoaded && ("space:"+room.parentSpace.roomid != Communities.currentTagId)
|
|
|
|
|
|
|
|
property string avatarUrl: (Settings.groupView && room && room.parentSpace && room.parentSpace.roomAvatarUrl) || ""
|
|
|
|
property string communityId: (Settings.groupView && room && room.parentSpace && room.parentSpace.roomid) || ""
|
|
|
|
property string communityName: (Settings.groupView && room && room.parentSpace && room.parentSpace.roomName) || ""
|
|
|
|
|
|
|
|
Layout.column: 1
|
|
|
|
Layout.row: 0
|
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
width: fontMetrics.lineSpacing
|
|
|
|
height: fontMetrics.lineSpacing
|
|
|
|
url: avatarUrl.replace("mxc://", "image://MxcImage/")
|
|
|
|
roomid: communityId
|
|
|
|
displayName: communityName
|
|
|
|
enabled: false
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
id: communityLabel
|
|
|
|
visible: communityAvatar.visible
|
|
|
|
|
|
|
|
Layout.column: 2
|
|
|
|
Layout.row: 0
|
|
|
|
Layout.fillWidth: true
|
|
|
|
color: Nheko.colors.text
|
|
|
|
text: qsTr("In %1").arg(communityAvatar.displayName)
|
|
|
|
maximumLineCount: 1
|
|
|
|
elide: Text.ElideRight
|
|
|
|
textFormat: Text.RichText
|
|
|
|
}
|
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
ImageButton {
|
|
|
|
id: backToRoomsButton
|
|
|
|
|
|
|
|
Layout.column: 0
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 1
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.rowSpan: 2
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium
|
|
|
|
Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium
|
|
|
|
visible: showBackButton
|
|
|
|
image: ":/icons/icons/ui/angle-arrow-left.svg"
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.text: qsTr("Back to room list")
|
|
|
|
onClicked: Rooms.resetCurrentRoom()
|
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
Avatar {
|
|
|
|
Layout.column: 1
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 1
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.rowSpan: 2
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
width: Nheko.avatarSize
|
|
|
|
height: Nheko.avatarSize
|
|
|
|
url: avatarUrl.replace("mxc://", "image://MxcImage/")
|
|
|
|
roomid: roomId
|
|
|
|
userid: isDirect ? directChatOtherUserId : ""
|
|
|
|
displayName: roomName
|
|
|
|
enabled: false
|
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.column: 2
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 1
|
2022-01-30 22:09:58 +03:00
|
|
|
color: Nheko.colors.text
|
|
|
|
font.pointSize: fontMetrics.font.pointSize * 1.1
|
2022-09-20 22:26:28 +03:00
|
|
|
font.bold: true
|
2022-01-30 22:09:58 +03:00
|
|
|
text: roomName
|
|
|
|
maximumLineCount: 1
|
|
|
|
elide: Text.ElideRight
|
|
|
|
textFormat: Text.RichText
|
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
MatrixText {
|
|
|
|
id: roomTopicC
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.column: 2
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 2
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.maximumHeight: fontMetrics.lineSpacing * 2 // show 2 lines
|
|
|
|
selectByMouse: false
|
|
|
|
enabled: false
|
|
|
|
clip: true
|
|
|
|
text: roomTopic
|
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
|
2022-10-06 22:59:59 +03:00
|
|
|
ImageButton {
|
|
|
|
id: pinButton
|
|
|
|
|
|
|
|
property bool pinsShown: !Settings.hiddenPins.includes(roomId)
|
|
|
|
|
|
|
|
visible: !!room && room.pinnedMessages.length > 0
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.column: 3
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 1
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.rowSpan: 2
|
2022-10-06 22:59:59 +03:00
|
|
|
Layout.alignment: Qt.AlignVCenter
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium
|
|
|
|
Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium
|
2022-10-06 22:59:59 +03:00
|
|
|
image: pinsShown ? ":/icons/icons/ui/pin.svg" : ":/icons/icons/ui/pin-off.svg"
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.text: qsTr("Show or hide pinned messages")
|
|
|
|
onClicked: {
|
|
|
|
var ps = Settings.hiddenPins;
|
|
|
|
if (pinsShown) {
|
|
|
|
ps.push(roomId);
|
|
|
|
} else {
|
|
|
|
const index = ps.indexOf(roomId);
|
|
|
|
if (index > -1) {
|
|
|
|
ps.splice(index, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Settings.hiddenPins = ps;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
AbstractButton {
|
|
|
|
Layout.column: 4
|
|
|
|
Layout.row: 1
|
|
|
|
Layout.rowSpan: 2
|
|
|
|
Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium
|
2022-12-07 15:09:41 +03:00
|
|
|
Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium
|
2022-03-05 03:44:10 +03:00
|
|
|
|
|
|
|
contentItem: EncryptionIndicator {
|
|
|
|
encrypted: isEncrypted
|
|
|
|
trust: trustlevel
|
|
|
|
enabled: false
|
2022-07-16 13:58:17 +03:00
|
|
|
unencryptedIcon: ":/icons/icons/ui/people.svg"
|
|
|
|
unencryptedColor: Nheko.colors.buttonText
|
2023-02-26 06:58:18 +03:00
|
|
|
unencryptedHoverColor: Nheko.colors.highlight
|
|
|
|
hovered: parent.hovered
|
|
|
|
|
|
|
|
ToolTip.delay: Nheko.tooltipDelay
|
|
|
|
ToolTip.text: {
|
|
|
|
if (!isEncrypted)
|
|
|
|
return qsTr("Show room members.");
|
|
|
|
|
|
|
|
switch (trustlevel) {
|
|
|
|
case Crypto.Verified:
|
|
|
|
return qsTr("This room contains only verified devices.");
|
|
|
|
case Crypto.TOFU:
|
|
|
|
return qsTr("This room contains verified devices and devices which have never changed their master key.");
|
|
|
|
default:
|
|
|
|
return qsTr("This room contains unverified devices!");
|
|
|
|
}
|
2022-01-30 22:09:58 +03:00
|
|
|
}
|
2021-08-14 00:13:09 +03:00
|
|
|
}
|
2022-03-05 03:44:10 +03:00
|
|
|
|
2023-02-26 06:58:18 +03:00
|
|
|
background: null
|
2022-03-05 03:44:10 +03:00
|
|
|
onClicked: TimelineManager.openRoomMembers(room)
|
2021-08-14 00:13:09 +03:00
|
|
|
}
|
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
ImageButton {
|
2022-10-06 22:59:59 +03:00
|
|
|
id: searchButton
|
2022-01-30 22:09:58 +03:00
|
|
|
|
2022-10-06 22:59:59 +03:00
|
|
|
property bool searchActive: false
|
2022-01-30 22:09:58 +03:00
|
|
|
|
2022-10-06 22:59:59 +03:00
|
|
|
visible: !!room
|
|
|
|
Layout.column: 5
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 1
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.rowSpan: 2
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium
|
|
|
|
Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium
|
2022-10-06 22:59:59 +03:00
|
|
|
image: ":/icons/icons/ui/search.svg"
|
2022-01-30 22:09:58 +03:00
|
|
|
ToolTip.visible: hovered
|
2022-10-06 22:59:59 +03:00
|
|
|
ToolTip.text: qsTr("Search this room")
|
2022-10-07 11:04:08 +03:00
|
|
|
onClicked: searchActive = !searchActive
|
|
|
|
|
|
|
|
onSearchActiveChanged: {
|
2022-10-06 22:59:59 +03:00
|
|
|
if (searchActive) {
|
|
|
|
searchField.forceActiveFocus();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
searchField.clear();
|
|
|
|
topBar.searchString = "";
|
2021-12-11 08:10:41 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
ImageButton {
|
|
|
|
id: roomOptionsButton
|
|
|
|
|
|
|
|
visible: !!room
|
2022-10-06 22:59:59 +03:00
|
|
|
Layout.column: 6
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 1
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.rowSpan: 2
|
|
|
|
Layout.alignment: Qt.AlignVCenter
|
|
|
|
Layout.preferredHeight: Nheko.avatarSize - Nheko.paddingMedium
|
|
|
|
Layout.preferredWidth: Nheko.avatarSize - Nheko.paddingMedium
|
|
|
|
image: ":/icons/icons/ui/options.svg"
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.text: qsTr("Room options")
|
|
|
|
onClicked: roomOptionsMenu.open(roomOptionsButton)
|
|
|
|
|
|
|
|
Platform.Menu {
|
|
|
|
id: roomOptionsMenu
|
|
|
|
|
|
|
|
Platform.MenuItem {
|
|
|
|
visible: room ? room.permissions.canInvite() : false
|
|
|
|
text: qsTr("Invite users")
|
|
|
|
onTriggered: TimelineManager.openInviteUsers(roomId)
|
|
|
|
}
|
2021-12-11 08:10:41 +03:00
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
Platform.MenuItem {
|
|
|
|
text: qsTr("Members")
|
|
|
|
onTriggered: TimelineManager.openRoomMembers(room)
|
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
Platform.MenuItem {
|
|
|
|
text: qsTr("Leave room")
|
|
|
|
onTriggered: TimelineManager.openLeaveRoomDialog(roomId)
|
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
Platform.MenuItem {
|
|
|
|
text: qsTr("Settings")
|
|
|
|
onTriggered: TimelineManager.openRoomSettings(roomId)
|
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
ScrollView {
|
|
|
|
id: pinnedMessages
|
|
|
|
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 3
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.column: 2
|
2022-10-06 22:59:59 +03:00
|
|
|
Layout.columnSpan: 4
|
2022-01-30 22:09:58 +03:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: Math.min(contentHeight, Nheko.avatarSize * 4)
|
|
|
|
|
|
|
|
visible: !!room && room.pinnedMessages.length > 0 && !Settings.hiddenPins.includes(roomId)
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
palette: Nheko.colors
|
|
|
|
ScrollBar.horizontal.visible: false
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
|
|
|
|
spacing: Nheko.paddingSmall
|
|
|
|
model: room ? room.pinnedMessages : undefined
|
|
|
|
delegate: RowLayout {
|
|
|
|
required property string modelData
|
|
|
|
|
|
|
|
width: ListView.view.width
|
|
|
|
height: implicitHeight
|
|
|
|
|
|
|
|
Reply {
|
2022-06-15 16:36:58 +03:00
|
|
|
id: reply
|
|
|
|
property var e: room ? room.getDump(modelData, "pins") : {}
|
|
|
|
Connections {
|
|
|
|
function onPinnedMessagesChanged() { reply.e = room.getDump(modelData, "pins") }
|
|
|
|
target: room
|
|
|
|
}
|
2022-01-30 22:09:58 +03:00
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: height
|
|
|
|
|
|
|
|
userColor: TimelineManager.userColor(e.userId, Nheko.colors.window)
|
|
|
|
blurhash: e.blurhash ?? ""
|
|
|
|
body: e.body ?? ""
|
|
|
|
formattedBody: e.formattedBody ?? ""
|
|
|
|
eventId: e.eventId ?? ""
|
|
|
|
filename: e.filename ?? ""
|
|
|
|
filesize: e.filesize ?? ""
|
|
|
|
proportionalHeight: e.proportionalHeight ?? 1
|
|
|
|
type: e.type ?? MtxEvent.UnknownMessage
|
|
|
|
typeString: e.typeString ?? ""
|
|
|
|
url: e.url ?? ""
|
|
|
|
originalWidth: e.originalWidth ?? 0
|
|
|
|
isOnlyEmoji: e.isOnlyEmoji ?? false
|
|
|
|
userId: e.userId ?? ""
|
|
|
|
userName: e.userName ?? ""
|
|
|
|
encryptionError: e.encryptionError ?? ""
|
2022-04-24 17:37:35 +03:00
|
|
|
keepFullText: true
|
2022-01-30 22:09:58 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
ImageButton {
|
|
|
|
id: deletePinButton
|
|
|
|
|
|
|
|
Layout.preferredHeight: 16
|
|
|
|
Layout.preferredWidth: 16
|
|
|
|
Layout.alignment: Qt.AlignTop | Qt.AlignLeft
|
|
|
|
visible: room.permissions.canChange(MtxEvent.PinnedEvents)
|
|
|
|
|
|
|
|
hoverEnabled: true
|
|
|
|
image: ":/icons/icons/ui/dismiss.svg"
|
|
|
|
ToolTip.visible: hovered
|
|
|
|
ToolTip.text: qsTr("Unpin")
|
|
|
|
|
|
|
|
onClicked: room.unpin(modelData)
|
|
|
|
}
|
2021-12-11 08:10:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-02-04 20:47:17 +03:00
|
|
|
ScrollHelper {
|
|
|
|
flickable: parent
|
|
|
|
anchors.fill: parent
|
|
|
|
enabled: !Settings.mobileMode
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ScrollView {
|
|
|
|
id: widgets
|
|
|
|
|
2022-09-20 22:26:28 +03:00
|
|
|
Layout.row: 4
|
2022-02-04 20:47:17 +03:00
|
|
|
Layout.column: 2
|
2022-10-06 22:59:59 +03:00
|
|
|
Layout.columnSpan: 4
|
2022-02-04 20:47:17 +03:00
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: Math.min(contentHeight, Nheko.avatarSize * 1.5)
|
|
|
|
|
|
|
|
visible: !!room && room.widgetLinks.length > 0 && !Settings.hiddenWidgets.includes(roomId)
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
palette: Nheko.colors
|
|
|
|
ScrollBar.horizontal.visible: false
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
|
|
|
|
spacing: Nheko.paddingSmall
|
|
|
|
model: room ? room.widgetLinks : undefined
|
|
|
|
delegate: MatrixText {
|
|
|
|
required property var modelData
|
|
|
|
|
|
|
|
color: Nheko.colors.text
|
|
|
|
text: modelData
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
ScrollHelper {
|
|
|
|
flickable: parent
|
|
|
|
anchors.fill: parent
|
|
|
|
enabled: !Settings.mobileMode
|
2021-12-11 08:10:41 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-10-06 22:59:59 +03:00
|
|
|
|
|
|
|
MatrixTextField {
|
|
|
|
id: searchField
|
|
|
|
visible: searchButton.searchActive
|
2022-12-13 20:09:34 +03:00
|
|
|
enabled: visible
|
2022-12-21 00:34:55 +03:00
|
|
|
hasClear: true
|
2022-10-06 22:59:59 +03:00
|
|
|
|
|
|
|
Layout.row: 5
|
|
|
|
Layout.column: 2
|
|
|
|
Layout.columnSpan: 4
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
placeholderText: qsTr("Enter search query")
|
|
|
|
onAccepted: topBar.searchString = text
|
|
|
|
}
|
2021-12-11 08:10:41 +03:00
|
|
|
}
|
2021-12-11 21:21:01 +03:00
|
|
|
|
2022-01-30 22:09:58 +03:00
|
|
|
CursorShape {
|
|
|
|
anchors.fill: parent
|
2022-02-04 20:47:17 +03:00
|
|
|
anchors.bottomMargin: (pinnedMessages.visible ? pinnedMessages.height : 0) + (widgets.visible ? widgets.height : 0)
|
2022-01-30 22:09:58 +03:00
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
}
|
2021-12-11 21:21:01 +03:00
|
|
|
}
|
2020-10-26 16:57:54 +03:00
|
|
|
}
|