summary refs log tree commit diff
path: root/resources/qml/components/UserListRow.qml
diff options
context:
space:
mode:
authorMalte E <97891689+maltee1@users.noreply.github.com>2023-02-01 00:59:49 +0800
committerGitHub <noreply@github.com>2023-01-31 16:59:49 +0000
commit5ed3bfc8f82e9123db4c198b6b9701df57c968f4 (patch)
tree9cb27ca2ed00830dba9d8adcc780d1b5296dd7cc /resources/qml/components/UserListRow.qml
parentMerge pull request #1319 from Decodetalkers/menuhideonwayland (diff)
downloadnheko-5ed3bfc8f82e9123db4c198b6b9701df57c968f4.tar.xz
add user search to invite dialog (#1253)
Diffstat (limited to 'resources/qml/components/UserListRow.qml')
-rw-r--r--resources/qml/components/UserListRow.qml53
1 files changed, 53 insertions, 0 deletions
diff --git a/resources/qml/components/UserListRow.qml b/resources/qml/components/UserListRow.qml
new file mode 100644

index 00000000..8cbbd195 --- /dev/null +++ b/resources/qml/components/UserListRow.qml
@@ -0,0 +1,53 @@ +// SPDX-FileCopyrightText: 2021 Nheko Contributors +// SPDX-FileCopyrightText: 2022 Nheko Contributors +// SPDX-FileCopyrightText: 2023 Nheko Contributors +// +// SPDX-License-Identifier: GPL-3.0-or-later + +import ".." +import QtQuick 2.12 +import QtQuick.Controls 2.12 +import QtQuick.Layouts 1.12 +import im.nheko 1.0 + +ItemDelegate { + property alias bgColor: background.color + property alias userid: avatar.userid + property alias displayName: avatar.displayName + property string avatarUrl + implicitHeight: layout.implicitHeight + Nheko.paddingSmall * 2 + background: Rectangle {id: background} + GridLayout { + id: layout + anchors.centerIn: parent + width: parent.width - Nheko.paddingSmall * 2 + rows: 2 + columns: 2 + rowSpacing: Nheko.paddingSmall + columnSpacing: Nheko.paddingMedium + + Avatar { + id: avatar + Layout.rowSpan: 2 + Layout.preferredWidth: Nheko.avatarSize + Layout.preferredHeight: Nheko.avatarSize + Layout.alignment: Qt.AlignLeft + url: avatarUrl.replace("mxc://", "image://MxcImage/") + enabled: false + } + Label { + Layout.fillWidth: true + text: displayName + color: TimelineManager.userColor(userid, Nheko.colors.window) + font.pointSize: fontMetrics.font.pointSize + } + + Label { + Layout.fillWidth: true + Layout.alignment: Qt.AlignTop + text: userid + color: Nheko.colors.buttonText + font.pointSize: fontMetrics.font.pointSize * 0.9 + } + } +}