2019-07-13 19:34:58 +10:00
|
|
|
// Copyright 2019 miruka
|
|
|
|
// This file is part of harmonyqml, licensed under LGPLv3.
|
|
|
|
|
|
|
|
import QtQuick 2.12
|
|
|
|
import QtQuick.Controls 2.12
|
|
|
|
import QtQuick.Layouts 1.12
|
|
|
|
import "../../Base"
|
|
|
|
import "../../utils.js" as Utils
|
|
|
|
|
2019-07-17 02:37:11 +10:00
|
|
|
HPage {
|
2019-07-14 10:15:20 +10:00
|
|
|
id: editAccount
|
2019-07-21 08:28:00 +10:00
|
|
|
Component.onCompleted: shortcuts.flickTarget = flickable
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-19 13:52:51 +10:00
|
|
|
property int avatarPreferredSize: 256
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-13 19:34:58 +10:00
|
|
|
property string userId: ""
|
|
|
|
readonly property var userInfo: users.find(userId)
|
2019-07-21 21:14:16 +10:00
|
|
|
readonly property bool ready: userInfo && ! userInfo.loading
|
2019-07-13 19:34:58 +10:00
|
|
|
|
2019-07-25 06:35:38 +10:00
|
|
|
property string headerName: userInfo ? userInfo.displayName : ""
|
|
|
|
|
2019-07-17 02:53:52 +10:00
|
|
|
hideHeaderUnderHeight: avatarPreferredSize
|
2019-07-25 06:35:38 +10:00
|
|
|
headerLabel.text: qsTr("Account settings for %1").arg(
|
|
|
|
Utils.coloredNameHtml(headerName, userId)
|
|
|
|
)
|
2019-07-13 19:34:58 +10:00
|
|
|
|
2019-07-17 02:37:11 +10:00
|
|
|
HRectangle {
|
2019-07-24 16:14:34 +10:00
|
|
|
color: ready ? theme.controls.box.background : "transparent"
|
2019-07-21 21:14:16 +10:00
|
|
|
Behavior on color { HColorAnimation {} }
|
2019-07-13 19:34:58 +10:00
|
|
|
|
2019-07-17 02:37:11 +10:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
2019-07-16 07:43:53 +10:00
|
|
|
|
2019-07-17 02:37:11 +10:00
|
|
|
Layout.maximumWidth: Math.min(parent.width, 640)
|
|
|
|
Layout.preferredWidth:
|
2019-07-19 13:59:05 +10:00
|
|
|
pageStack.isWide ? parent.width : avatarPreferredSize
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-17 02:37:11 +10:00
|
|
|
Layout.preferredHeight: childrenRect.height
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-21 21:14:16 +10:00
|
|
|
Loader {
|
|
|
|
width: parent.width
|
|
|
|
source: ready ? "Profile.qml" : "../../Base/HBusyIndicator.qml"
|
|
|
|
}
|
2019-07-13 19:34:58 +10:00
|
|
|
}
|
|
|
|
}
|