User: add type info

pull/30/head
reionwong 4 years ago
parent 12dc0e6180
commit f7589ed1bf

@ -23,9 +23,13 @@ import QtGraphicalEffects 1.0
Item { Item {
id: _root id: _root
implicitHeight: shown ? _content.implicitHeight : 0 implicitHeight: shown ? _contentLayout.implicitHeight : 0
clip: true
Layout.fillWidth: true Layout.fillWidth: true
clip: true
default property alias content: _contentLayout.data
property bool shown: false
property alias spacing: _contentLayout.spacing
Behavior on implicitHeight { Behavior on implicitHeight {
NumberAnimation { NumberAnimation {
@ -34,8 +38,10 @@ Item {
} }
} }
property bool shown: false ColumnLayout {
default property alias content: _content.data id: _contentLayout
anchors.fill: parent
}
function show() { function show() {
shown = true shown = true
@ -48,9 +54,4 @@ Item {
function toggle() { function toggle() {
shown = !shown shown = !shown
} }
ColumnLayout {
id: _content
anchors.fill: parent
}
} }

@ -52,7 +52,6 @@ RoundedItem {
ColumnLayout { ColumnLayout {
id: mainLayout id: mainLayout
// anchors.fill: parent
spacing: 0 spacing: 0
RowLayout { RowLayout {
@ -137,23 +136,16 @@ RoundedItem {
visible: currentUser.userId === loggedUser.userId visible: currentUser.userId === loggedUser.userId
} }
Button { Item {
Layout.alignment: Qt.AlignVCenter width: FishUI.Units.smallSpacing
}
onClicked: additionalSettings.toggle()
implicitWidth: height
background: Item {}
Image { FishUI.RoundImageButton {
anchors.centerIn: parent iconMargins: FishUI.Units.smallSpacing
width: 22
height: 22
sourceSize: Qt.size(width, height)
source: FishUI.Theme.darkMode ? additionalSettings.shown ? "qrc:/images/dark/up.svg" : "qrc:/images/dark/down.svg" source: FishUI.Theme.darkMode ? additionalSettings.shown ? "qrc:/images/dark/up.svg" : "qrc:/images/dark/down.svg"
: additionalSettings.shown ? "qrc:/images/light/up.svg" : "qrc:/images/light/down.svg" : additionalSettings.shown ? "qrc:/images/light/up.svg" : "qrc:/images/light/down.svg"
} onClicked: additionalSettings.toggle()
Layout.alignment: Qt.AlignVCenter
} }
} }
} }
@ -161,6 +153,7 @@ RoundedItem {
Hideable { Hideable {
id: additionalSettings id: additionalSettings
spacing: FishUI.Units.largeSpacing
Item { Item {
height: FishUI.Units.largeSpacing height: FishUI.Units.largeSpacing
@ -169,9 +162,18 @@ RoundedItem {
GridLayout { GridLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: FishUI.Units.smallSpacing Layout.bottomMargin: FishUI.Units.smallSpacing
rowSpacing: FishUI.Units.largeSpacing rowSpacing: FishUI.Units.largeSpacing * 2
columns: 2 columns: 2
Label {
text: qsTr("Account type")
}
Label {
text: currentUser.accountType === 0 ? qsTr("Standard")
: qsTr("Administrator")
}
Label { Label {
text: qsTr("Automatic login") text: qsTr("Automatic login")
Layout.fillWidth: true Layout.fillWidth: true
@ -191,6 +193,13 @@ RoundedItem {
} }
} }
StandardButton {
text: qsTr("Change password")
// onClicked: accountsManager.deleteUser(userId, true)
backgroundColor: FishUI.Theme.darkMode ? "#363636" : FishUI.Theme.backgroundColor
Layout.fillWidth: true
}
StandardButton { StandardButton {
text: qsTr("Delete this user") text: qsTr("Delete this user")
enabled: model.userId !== loggedUser.userId enabled: model.userId !== loggedUser.userId

@ -744,11 +744,26 @@
</message> </message>
<message> <message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="176"/> <location filename="../src/qml/User/UserDelegateItem.qml" line="176"/>
<source>Account type</source>
<translation type="unfinished">Account type</translation>
</message>
<message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="180"/>
<source>Standard</source>
<translation type="unfinished">Standard</translation>
</message>
<message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="181"/>
<source>Administrator</source>
<translation type="unfinished">Administrator</translation>
</message>
<message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="185"/>
<source>Automatic login</source> <source>Automatic login</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="195"/> <location filename="../src/qml/User/UserDelegateItem.qml" line="204"/>
<source>Delete this user</source> <source>Delete this user</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

@ -752,11 +752,26 @@
</message> </message>
<message> <message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="176"/> <location filename="../src/qml/User/UserDelegateItem.qml" line="176"/>
<source>Account type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="180"/>
<source>Standard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="181"/>
<source>Administrator</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="185"/>
<source>Automatic login</source> <source>Automatic login</source>
<translation></translation> <translation></translation>
</message> </message>
<message> <message>
<location filename="../src/qml/User/UserDelegateItem.qml" line="195"/> <location filename="../src/qml/User/UserDelegateItem.qml" line="204"/>
<source>Delete this user</source> <source>Delete this user</source>
<translation></translation> <translation></translation>
</message> </message>

Loading…
Cancel
Save