diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceSection.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceSection.qml new file mode 100644 index 00000000..0a425376 --- /dev/null +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberDeviceSection.qml @@ -0,0 +1,37 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later + +import QtQuick 2.12 +import QtQuick.Layouts 1.12 +import "../../../../Base" + +HRowLayout { + spacing: theme.spacing / 2 + + HIcon { + svgName: "device-" + section + colorize: + section === "verified" ? theme.colors.positiveText : + section === "blacklisted" ? theme.colors.errorText : + theme.colors.warningText + + Layout.preferredHeight: dimension + Layout.leftMargin: theme.spacing / 2 + } + + HLabel { + wrapMode: HLabel.Wrap + verticalAlignment: Qt.AlignVCenter + + text: + section === "unset" ? qsTr("Unverified sessions") : + section === "verified" ? qsTr("Verified sessions") : + section === "ignored" ? qsTr("Ignored sessions") : + qsTr("Blacklisted sessions") + + Layout.fillWidth: true + Layout.fillHeight: true + Layout.topMargin: theme.spacing + Layout.bottomMargin: theme.spacing + Layout.rightMargin: theme.spacing / 2 + } +} diff --git a/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml b/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml index 79116f68..c9ae034a 100644 --- a/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml +++ b/src/gui/Pages/Chat/RoomPane/MemberView/MemberProfile.qml @@ -37,37 +37,8 @@ HListView { } section.property: "type" - section.delegate: RowLayout { + section.delegate: MemberDeviceSection { width: profile.width - spacing: theme.spacing / 2 - - HIcon { - svgName: "device-" + section - colorize: - section === "verified" ? theme.colors.positiveText : - section === "blacklisted" ? theme.colors.errorText : - theme.colors.warningText - - Layout.preferredHeight: dimension - Layout.leftMargin: theme.spacing / 2 - } - - HLabel { - wrapMode: HLabel.Wrap - verticalAlignment: Qt.AlignVCenter - - text: - section === "unset" ? qsTr("Unverified sessions") : - section === "verified" ? qsTr("Verified sessions") : - section === "ignored" ? qsTr("Ignored sessions") : - qsTr("Blacklisted sessions") - - Layout.fillWidth: true - Layout.fillHeight: true - Layout.topMargin: theme.spacing - Layout.bottomMargin: theme.spacing - Layout.rightMargin: theme.spacing / 2 - } } header: HColumnLayout {