Compare commits
1 Commits
master
...
work/tobia
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd5dd1dd54 |
@@ -282,6 +282,7 @@ ecm_add_qml_module(neochat URI org.kde.neochat GENERATE_PLUGIN_SOURCE
|
|||||||
qml/ConsentDialog.qml
|
qml/ConsentDialog.qml
|
||||||
qml/AskDirectChatConfirmation.qml
|
qml/AskDirectChatConfirmation.qml
|
||||||
qml/HoverLinkIndicator.qml
|
qml/HoverLinkIndicator.qml
|
||||||
|
qml/AccountDialog.qml
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
QtCore
|
QtCore
|
||||||
QtQuick
|
QtQuick
|
||||||
|
|||||||
84
src/qml/AccountDialog.qml
Normal file
84
src/qml/AccountDialog.qml
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2019 Black Hat <bhat@encom.eu.org>
|
||||||
|
// SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>
|
||||||
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls as QQC2
|
||||||
|
import QtQuick.Layouts
|
||||||
|
|
||||||
|
import org.kde.kirigami as Kirigami
|
||||||
|
import org.kde.kirigamiaddons.components as KirigamiComponents
|
||||||
|
import org.kde.kirigamiaddons.formcard as FormCard
|
||||||
|
import org.kde.prison
|
||||||
|
|
||||||
|
import org.kde.neochat
|
||||||
|
|
||||||
|
Kirigami.Dialog {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property NeoChatConnection connection
|
||||||
|
|
||||||
|
leftPadding: 0
|
||||||
|
rightPadding: 0
|
||||||
|
topPadding: 0
|
||||||
|
bottomPadding: 0
|
||||||
|
|
||||||
|
standardButtons: Kirigami.Dialog.NoButton
|
||||||
|
|
||||||
|
width: Math.min(QQC2.ApplicationWindow.window.width, Kirigami.Units.gridUnit * 24)
|
||||||
|
|
||||||
|
contentItem: ColumnLayout {
|
||||||
|
spacing: 0
|
||||||
|
|
||||||
|
KirigamiComponents.Avatar {
|
||||||
|
id: avatar
|
||||||
|
|
||||||
|
readonly property string mediaId: root.connection.localUser.avatarMediaId
|
||||||
|
|
||||||
|
Layout.preferredWidth: Kirigami.Units.iconSizes.huge * 2
|
||||||
|
Layout.preferredHeight: Kirigami.Units.iconSizes.huge * 2
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
|
name: root.room ? root.room.member(root.user.id).displayName : root.user.displayName
|
||||||
|
source: mediaId ? root.connection.makeMediaUrl("mxc://" + mediaId) : ""
|
||||||
|
color: root.room ? root.room.member(root.user.id).color : QmlUtils.getUserColor(root.user.hueF)
|
||||||
|
}
|
||||||
|
|
||||||
|
QQC2.Label {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
font.bold: false
|
||||||
|
font.weight: Font.DemiBold
|
||||||
|
font.pixelSize: 32
|
||||||
|
|
||||||
|
elide: Text.ElideRight
|
||||||
|
wrapMode: Text.NoWrap
|
||||||
|
text: root.connection.localUser.displayName
|
||||||
|
textFormat: Text.PlainText
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
Kirigami.SelectableLabel {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.bottomMargin: Kirigami.Units.largeSpacing
|
||||||
|
font.pixelSize: 16
|
||||||
|
textFormat: TextEdit.PlainText
|
||||||
|
text: root.connection.localUser.id
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
}
|
||||||
|
FormCard.FormDelegateSeparator {}
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
|
text: i18n("Edit Account")
|
||||||
|
}
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
|
text: i18n("Switch Account")
|
||||||
|
}
|
||||||
|
FormCard.FormButtonDelegate {
|
||||||
|
text: i18n("Logout")
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
Component {
|
||||||
|
id: qrMaximizeComponent
|
||||||
|
QrCodeMaximizeComponent {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -227,11 +227,6 @@ Kirigami.Page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
footer: Loader {
|
|
||||||
width: parent.width
|
|
||||||
sourceComponent: Kirigami.Settings.isMobile ? exploreComponentMobile : userInfoDesktop
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|||||||
@@ -47,6 +47,22 @@ QQC2.Control {
|
|||||||
width: scrollView.width
|
width: scrollView.width
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
|
AvatarTabButton {
|
||||||
|
readonly property string mediaId: root.connection.localUser.avatarMediaId
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: width - Kirigami.Units.smallSpacing
|
||||||
|
Layout.maximumHeight: width - Kirigami.Units.smallSpacing
|
||||||
|
Layout.topMargin: Kirigami.Units.smallSpacing / 2
|
||||||
|
Layout.bottomMargin: Kirigami.Units.smallSpacing / 2
|
||||||
|
|
||||||
|
text: root.connection.localUser.displayName
|
||||||
|
source: mediaId ? root.connection.makeMediaUrl("mxc://" + mediaId) : ""
|
||||||
|
onClicked: Qt.createComponent("org.kde.neochat", "AccountDialog").createObject(root, {
|
||||||
|
connection: root.connection
|
||||||
|
}).open()
|
||||||
|
}
|
||||||
|
|
||||||
AvatarTabButton {
|
AvatarTabButton {
|
||||||
id: notificationsButton
|
id: notificationsButton
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user