From e36b461d9697db75aaeb01f555b98c53903f8a31 Mon Sep 17 00:00:00 2001 From: reionwong Date: Fri, 23 Jul 2021 11:56:17 +0800 Subject: [PATCH] Replace some icons --- src/images/rot180.svg | 76 ++++++++++--------------------- src/images/rot270.svg | 76 ++++++++++--------------------- src/images/rot90.svg | 76 ++++++++++--------------------- src/images/rotnormal.svg | 74 +++++++++--------------------- src/qml/User/Main.qml | 58 +++++++++++++++-------- src/qml/User/UserDelegateItem.qml | 16 +++++-- 6 files changed, 141 insertions(+), 235 deletions(-) diff --git a/src/images/rot180.svg b/src/images/rot180.svg index 4ac0743..d554fd9 100644 --- a/src/images/rot180.svg +++ b/src/images/rot180.svg @@ -1,54 +1,24 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + + + diff --git a/src/images/rot270.svg b/src/images/rot270.svg index 455670f..419ff37 100644 --- a/src/images/rot270.svg +++ b/src/images/rot270.svg @@ -1,54 +1,24 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + + + diff --git a/src/images/rot90.svg b/src/images/rot90.svg index c87cf8a..8076319 100644 --- a/src/images/rot90.svg +++ b/src/images/rot90.svg @@ -1,54 +1,24 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - \ No newline at end of file + + + diff --git a/src/images/rotnormal.svg b/src/images/rotnormal.svg index 713202f..2caec57 100644 --- a/src/images/rotnormal.svg +++ b/src/images/rotnormal.svg @@ -1,52 +1,22 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/qml/User/Main.qml b/src/qml/User/Main.qml index 36b8756..e9d4d2c 100644 --- a/src/qml/User/Main.qml +++ b/src/qml/User/Main.qml @@ -51,30 +51,50 @@ ItemPage { anchors.fill: parent spacing: FishUI.Units.largeSpacing * 2 - RoundedItem { - visible: _userView.count > 0 - - ListView { - id: _userView - model: userModel - Layout.fillWidth: true - spacing: FishUI.Units.largeSpacing * 2 - interactive: false - - Layout.preferredHeight: { - var totalHeight = 0 - for (var i = 0; i < _userView.visibleChildren.length; ++i) { - totalHeight += _userView.visibleChildren[i].height - } - return totalHeight - } + ListView { + id: _userView + model: userModel + Layout.fillWidth: true + spacing: FishUI.Units.largeSpacing * 2 + interactive: false - delegate: UserDelegateItem { - width: _userView.width + Layout.preferredHeight: { + var totalHeight = 0 + for (var i = 0; i < _userView.visibleChildren.length; ++i) { + totalHeight += _userView.visibleChildren[i].height } + return totalHeight + } + + delegate: UserDelegateItem { + width: _userView.width } } +// RoundedItem { +// visible: _userView.count > 0 + +// ListView { +// id: _userView +// model: userModel +// Layout.fillWidth: true +// spacing: FishUI.Units.largeSpacing * 2 +// interactive: false + +// Layout.preferredHeight: { +// var totalHeight = 0 +// for (var i = 0; i < _userView.visibleChildren.length; ++i) { +// totalHeight += _userView.visibleChildren[i].height +// } +// return totalHeight +// } + +// delegate: UserDelegateItem { +// width: _userView.width +// } +// } +// } + StandardButton { id: _addUserButton text: qsTr("Add user") diff --git a/src/qml/User/UserDelegateItem.qml b/src/qml/User/UserDelegateItem.qml index 88d6fa0..ff8110d 100644 --- a/src/qml/User/UserDelegateItem.qml +++ b/src/qml/User/UserDelegateItem.qml @@ -29,10 +29,10 @@ import FishUI 1.0 as FishUI import "../" -Item { +RoundedItem { id: control - height: mainLayout.implicitHeight + height: mainLayout.implicitHeight + FishUI.Units.largeSpacing * 2 UserAccount { id: currentUser @@ -52,7 +52,7 @@ Item { ColumnLayout { id: mainLayout - anchors.fill: parent + // anchors.fill: parent spacing: 0 RowLayout { @@ -76,8 +76,8 @@ Item { Image { id: _userImage - width: 32 - height: 32 + width: 48 + height: 48 sourceSize: Qt.size(width, height) source: iconFileName ? "file:///" + iconFileName : "image://icontheme/default-user" visible: status === Image.Ready @@ -105,6 +105,7 @@ Item { Label { Layout.alignment: Qt.AlignVCenter + font.pixelSize: 15 text: "%1".arg(userName) leftPadding: FishUI.Units.largeSpacing } @@ -180,6 +181,11 @@ Item { } } + Button { + text:"修改密码" + Layout.fillWidth: true + } + Button { text: qsTr("Delete this user") enabled: model.userId !== loggedUser.userId