diff --git a/src/qml/Hideable.qml b/src/qml/Hideable.qml index ced8123..ca5bbc7 100644 --- a/src/qml/Hideable.qml +++ b/src/qml/Hideable.qml @@ -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 - } } diff --git a/src/qml/User/UserDelegateItem.qml b/src/qml/User/UserDelegateItem.qml index 9cb6cf1..40cd4fa 100644 --- a/src/qml/User/UserDelegateItem.qml +++ b/src/qml/User/UserDelegateItem.qml @@ -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 diff --git a/translations/en_US.ts b/translations/en_US.ts index 0fc5d29..7a09338 100644 --- a/translations/en_US.ts +++ b/translations/en_US.ts @@ -744,11 +744,26 @@ + Account type + Account type + + + + Standard + Standard + + + + Administrator + Administrator + + + Automatic login - + Delete this user diff --git a/translations/zh_CN.ts b/translations/zh_CN.ts index 5f85574..0458c8b 100644 --- a/translations/zh_CN.ts +++ b/translations/zh_CN.ts @@ -752,11 +752,26 @@ + Account type + 类型 + + + + Standard + 标准 + + + + Administrator + 管理员 + + + Automatic login 自动登陆 - + Delete this user 删除该用户