User: add type info

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

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

@ -52,7 +52,6 @@ RoundedItem {
ColumnLayout {
id: mainLayout
// anchors.fill: parent
spacing: 0
RowLayout {
@ -137,23 +136,16 @@ RoundedItem {
visible: currentUser.userId === loggedUser.userId
}
Button {
Layout.alignment: Qt.AlignVCenter
Item {
width: FishUI.Units.smallSpacing
}
FishUI.RoundImageButton {
iconMargins: FishUI.Units.smallSpacing
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"
onClicked: additionalSettings.toggle()
implicitWidth: height
background: Item {}
Image {
anchors.centerIn: parent
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"
: additionalSettings.shown ? "qrc:/images/light/up.svg" : "qrc:/images/light/down.svg"
}
Layout.alignment: Qt.AlignVCenter
}
}
}
@ -161,6 +153,7 @@ RoundedItem {
Hideable {
id: additionalSettings
spacing: FishUI.Units.largeSpacing
Item {
height: FishUI.Units.largeSpacing
@ -169,9 +162,18 @@ RoundedItem {
GridLayout {
Layout.fillWidth: true
Layout.bottomMargin: FishUI.Units.smallSpacing
rowSpacing: FishUI.Units.largeSpacing
rowSpacing: FishUI.Units.largeSpacing * 2
columns: 2
Label {
text: qsTr("Account type")
}
Label {
text: currentUser.accountType === 0 ? qsTr("Standard")
: qsTr("Administrator")
}
Label {
text: qsTr("Automatic login")
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 {
text: qsTr("Delete this user")
enabled: model.userId !== loggedUser.userId

@ -744,11 +744,26 @@
</message>
<message>
<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>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>

@ -752,11 +752,26 @@
</message>
<message>
<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>
<translation></translation>
</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>
<translation></translation>
</message>

Loading…
Cancel
Save