2019-12-08 13:32:22 +03:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Window 2.2
|
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
import QtQuick.Layouts 1.2
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
|
|
|
|
Connections {
|
2020-01-03 15:09:29 +03:00
|
|
|
target: userModelBackend
|
2019-12-08 13:32:22 +03:00
|
|
|
onRefreshUserMenu: {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
id: userLine
|
|
|
|
width: 216
|
2020-01-05 23:06:42 +03:00
|
|
|
height: 60
|
2019-12-08 13:32:22 +03:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: userLineBackground
|
|
|
|
height: userLine.height
|
|
|
|
anchors.fill: parent
|
|
|
|
color: "transparent"
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: userLineLayout
|
|
|
|
spacing: 0
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: accountButton
|
|
|
|
anchors.centerIn: parent
|
|
|
|
Layout.preferredWidth: (userLine.width - 4)
|
|
|
|
Layout.preferredHeight: (userLineBackground.height - 2)
|
|
|
|
display: AbstractButton.IconOnly
|
|
|
|
flat: true
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
2020-01-03 15:09:29 +03:00
|
|
|
userModelBackend.switchCurrentUser(index)
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
|
|
|
id: accountControlRowLayout
|
|
|
|
height: accountButton.height
|
|
|
|
width: accountButton.width
|
|
|
|
spacing: 0
|
|
|
|
Image {
|
|
|
|
id: accountAvatar
|
2020-01-05 23:06:42 +03:00
|
|
|
Layout.leftMargin: 2
|
2019-12-08 13:32:22 +03:00
|
|
|
verticalAlignment: Qt.AlignCenter
|
2020-01-03 15:09:29 +03:00
|
|
|
source: ("image://avatars/" + index)
|
2019-12-08 13:32:22 +03:00
|
|
|
Layout.preferredHeight: (userLineBackground.height -16)
|
|
|
|
Layout.preferredWidth: (userLineBackground.height -16)
|
|
|
|
}
|
|
|
|
|
|
|
|
Column {
|
|
|
|
id: accountLabels
|
|
|
|
spacing: 4
|
|
|
|
Layout.alignment: Qt.AlignLeft
|
|
|
|
Layout.leftMargin: 12
|
|
|
|
Label {
|
|
|
|
id: accountUser
|
2020-01-05 23:06:42 +03:00
|
|
|
width: 120
|
2019-12-08 13:32:22 +03:00
|
|
|
text: name
|
2020-01-05 23:06:42 +03:00
|
|
|
elide: Text.ElideRight
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "black"
|
2020-01-04 19:22:56 +03:00
|
|
|
font.pixelSize: 12
|
2019-12-08 13:32:22 +03:00
|
|
|
font.bold: true
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
id: accountServer
|
2020-01-05 23:06:42 +03:00
|
|
|
width: 120
|
2019-12-08 13:32:22 +03:00
|
|
|
text: server
|
2020-01-05 23:06:42 +03:00
|
|
|
elide: Text.ElideRight
|
2019-12-08 13:32:22 +03:00
|
|
|
color: "black"
|
2020-01-04 19:22:56 +03:00
|
|
|
font.pixelSize: 10
|
2019-12-08 13:32:22 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: userLineSpacer
|
|
|
|
Layout.fillWidth: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // Rectangle userLineBackground
|
|
|
|
} // MenuItem userLine
|