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-14 10:15:20 +10:00
|
|
|
Page {
|
|
|
|
id: editAccount
|
|
|
|
|
|
|
|
property bool wide: width > 414 + padding * 2
|
2019-07-16 08:10:11 +10:00
|
|
|
property int avatarPreferredSize: theme.minimumSupportedWidth
|
2019-07-14 10:15:20 +10:00
|
|
|
property int normalSpacing: 8
|
|
|
|
property int currentSpacing:
|
|
|
|
Math.min(normalSpacing * width / 400, normalSpacing * 2)
|
|
|
|
|
2019-07-13 19:34:58 +10:00
|
|
|
property string userId: ""
|
|
|
|
readonly property var userInfo: users.find(userId)
|
|
|
|
|
2019-07-14 10:15:20 +10:00
|
|
|
header: HRectangle {
|
|
|
|
width: parent.width
|
|
|
|
color: theme.pageHeadersBackground
|
2019-07-13 19:34:58 +10:00
|
|
|
|
2019-07-16 08:10:11 +10:00
|
|
|
height: window.height <
|
|
|
|
avatarPreferredSize +
|
|
|
|
theme.bottomElementsHeight +
|
|
|
|
currentSpacing * 2 ?
|
|
|
|
0 : theme.bottomElementsHeight
|
|
|
|
|
|
|
|
Behavior on height { HNumberAnimation {} }
|
|
|
|
visible: height > 0
|
|
|
|
|
2019-07-13 19:34:58 +10:00
|
|
|
HRowLayout {
|
2019-07-14 10:15:20 +10:00
|
|
|
width: parent.width
|
2019-07-13 19:34:58 +10:00
|
|
|
|
|
|
|
HLabel {
|
2019-07-14 10:15:20 +10:00
|
|
|
text: qsTr("Account settings for %1").arg(
|
2019-07-13 19:34:58 +10:00
|
|
|
Utils.coloredNameHtml(userInfo.displayName, userId)
|
|
|
|
)
|
|
|
|
textFormat: Text.StyledText
|
|
|
|
font.pixelSize: theme.fontSize.big
|
|
|
|
elide: Text.ElideRight
|
|
|
|
maximumLineCount: 1
|
2019-07-16 08:10:11 +10:00
|
|
|
horizontalAlignment: Text.AlignHCenter
|
2019-07-13 19:34:58 +10:00
|
|
|
|
2019-07-14 10:15:20 +10:00
|
|
|
Layout.leftMargin: currentSpacing
|
2019-07-13 19:34:58 +10:00
|
|
|
Layout.rightMargin: Layout.leftMargin
|
2019-07-14 10:15:20 +10:00
|
|
|
Layout.fillWidth: true
|
2019-07-13 19:34:58 +10:00
|
|
|
}
|
|
|
|
}
|
2019-07-14 10:15:20 +10:00
|
|
|
}
|
2019-07-13 19:34:58 +10:00
|
|
|
|
2019-07-14 10:15:20 +10:00
|
|
|
background: null
|
2019-07-13 19:34:58 +10:00
|
|
|
|
2019-07-16 08:10:11 +10:00
|
|
|
leftPadding: currentSpacing < 8 ? 0 : currentSpacing
|
|
|
|
rightPadding: leftPadding
|
|
|
|
Behavior on leftPadding { HNumberAnimation {} }
|
2019-07-16 07:43:53 +10:00
|
|
|
|
|
|
|
Flickable {
|
|
|
|
id: flickable
|
2019-07-14 10:15:20 +10:00
|
|
|
anchors.fill: parent
|
2019-07-16 07:43:53 +10:00
|
|
|
clip: true
|
|
|
|
contentWidth: parent.width
|
|
|
|
contentHeight: boxColumn.childrenRect.height
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-16 07:43:53 +10:00
|
|
|
HColumnLayout {
|
|
|
|
id: boxColumn
|
|
|
|
spacing: 16
|
|
|
|
width: flickable.width
|
|
|
|
height: flickable.height
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-16 07:43:53 +10:00
|
|
|
HRectangle {
|
|
|
|
color: theme.box.background
|
|
|
|
// radius: theme.box.radius
|
2019-07-13 19:34:58 +10:00
|
|
|
|
2019-07-16 07:43:53 +10:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-16 07:43:53 +10:00
|
|
|
Layout.maximumWidth: Math.min(parent.width, 640)
|
|
|
|
Layout.preferredWidth:
|
2019-07-16 08:10:11 +10:00
|
|
|
wide ? parent.width : avatarPreferredSize
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-16 07:43:53 +10:00
|
|
|
Layout.preferredHeight: childrenRect.height
|
|
|
|
|
|
|
|
Profile { width: parent.width }
|
|
|
|
}
|
2019-07-14 10:15:20 +10:00
|
|
|
|
2019-07-16 07:43:53 +10:00
|
|
|
// HRectangle {
|
|
|
|
// color: theme.box.background
|
|
|
|
// radius: theme.box.radius
|
|
|
|
// ClientSettings { width: parent.width }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// HRectangle {
|
|
|
|
// color: theme.box.background
|
|
|
|
// radius: theme.box.radius
|
|
|
|
// Devices { width: parent.width }
|
|
|
|
// }
|
|
|
|
}
|
2019-07-13 19:34:58 +10:00
|
|
|
}
|
|
|
|
}
|