Perfect user page UI

pull/11/head
cutefishd 5 years ago
parent e66203ae4c
commit 6228ba7e16

@ -31,14 +31,14 @@ ItemPage {
ColumnLayout { ColumnLayout {
id: layout id: layout
anchors.fill: parent anchors.fill: parent
spacing: FishUI.Units.largeSpacing
RoundedItem { RoundedItem {
ListView { ListView {
id: _userView id: _userView
model: userModel model: userModel
Layout.fillWidth: true Layout.fillWidth: true
spacing: FishUI.Units.largeSpacing spacing: FishUI.Units.largeSpacing * 2
interactive: false interactive: false
Layout.preferredHeight: { Layout.preferredHeight: {
@ -46,7 +46,7 @@ ItemPage {
for (var i = 0; i < _userView.visibleChildren.length; ++i) { for (var i = 0; i < _userView.visibleChildren.length; ++i) {
totalHeight += _userView.visibleChildren[i].height totalHeight += _userView.visibleChildren[i].height
} }
totalHeight += (_userView.count - 1) * _userView.spacing // totalHeight += (_userView.count - 1) * _userView.spacing
return totalHeight return totalHeight
} }
@ -56,14 +56,12 @@ ItemPage {
width: _userView.width width: _userView.width
} }
} }
Item {
height: FishUI.Units.smallSpacing
} }
Button { Button {
id: _addUserButton id: _addUserButton
text: qsTr("Add user") text: qsTr("Add user")
Layout.fillWidth: true
onClicked: { onClicked: {
var component = Qt.createComponent("AddUserDialog.qml") var component = Qt.createComponent("AddUserDialog.qml")
if (component.status === Component.Ready) { if (component.status === Component.Ready) {
@ -75,4 +73,3 @@ ItemPage {
} }
} }
} }
}

@ -191,7 +191,8 @@ ItemPage {
rows: 3 rows: 3
columns: 2 columns: 2
columnSpacing: FishUI.Units.largeSpacing * 2 columnSpacing: FishUI.Units.largeSpacing * 1.5
rowSpacing: FishUI.Units.largeSpacing
Label { Label {
text: qsTr("General Font") text: qsTr("General Font")
@ -203,6 +204,8 @@ ItemPage {
model: fontsModel.generalFonts model: fontsModel.generalFonts
enabled: true enabled: true
Layout.fillWidth: true Layout.fillWidth: true
topInset: 0
bottomInset: 0
onActivated: appearance.setGenericFontFamily(currentText) onActivated: appearance.setGenericFontFamily(currentText)
} }
@ -216,6 +219,8 @@ ItemPage {
model: fontsModel.fixedFonts model: fontsModel.fixedFonts
enabled: true enabled: true
Layout.fillWidth: true Layout.fillWidth: true
topInset: 0
bottomInset: 0
onActivated: appearance.setFixedFontFamily(currentText) onActivated: appearance.setFixedFontFamily(currentText)
} }

@ -125,8 +125,8 @@ ItemPage {
GridLayout { GridLayout {
columns: 2 columns: 2
columnSpacing: FishUI.Units.largeSpacing columnSpacing: FishUI.Units.largeSpacing * 1.5
rowSpacing: FishUI.Units.smallSpacing rowSpacing: FishUI.Units.largeSpacing
Label { Label {
text: qsTr("Resolution") text: qsTr("Resolution")
@ -135,6 +135,8 @@ ItemPage {
ComboBox { ComboBox {
Layout.fillWidth: true Layout.fillWidth: true
model: element.resolutions model: element.resolutions
topInset: 0
bottomInset: 0
currentIndex: element.resolutionIndex !== undefined ? currentIndex: element.resolutionIndex !== undefined ?
element.resolutionIndex : -1 element.resolutionIndex : -1
onActivated: { onActivated: {
@ -151,6 +153,8 @@ ItemPage {
id: refreshRate id: refreshRate
Layout.fillWidth: true Layout.fillWidth: true
model: element.refreshRates model: element.refreshRates
topInset: 0
bottomInset: 0
currentIndex: element.refreshRateIndex ? currentIndex: element.refreshRateIndex ?
element.refreshRateIndex : 0 element.refreshRateIndex : 0
onActivated: { onActivated: {

@ -144,10 +144,11 @@ Item {
} }
radius: FishUI.Theme.mediumRadius radius: FishUI.Theme.mediumRadius
color: mouseArea.containsMouse ? Qt.rgba(FishUI.Theme.textColor.r, color: mouseArea.containsMouse && !isCurrent ? Qt.rgba(FishUI.Theme.textColor.r,
FishUI.Theme.textColor.g, FishUI.Theme.textColor.g,
FishUI.Theme.textColor.b, FishUI.Theme.textColor.b,
0.1) : "transparent" 0.1) : "transparent"
smooth: true smooth: true
} }

@ -63,6 +63,12 @@ Item {
source: iconFileName ? "file:///" + iconFileName : "image://icontheme/default-user" source: iconFileName ? "file:///" + iconFileName : "image://icontheme/default-user"
visible: status === Image.Ready visible: status === Image.Ready
MouseArea {
anchors.fill: parent
onClicked: fileDialog.open()
cursorShape: Qt.PointingHandCursor
}
layer.enabled: true layer.enabled: true
layer.effect: OpacityMask { layer.effect: OpacityMask {
maskSource: Item { maskSource: Item {
@ -123,30 +129,19 @@ Item {
} }
} }
Hideable {
id: additionalSettings
Item { Item {
height: FishUI.Units.largeSpacing height: FishUI.Units.largeSpacing
} }
Hideable {
id: additionalSettings
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
columns: 2 columns: 2
Label {
text: qsTr("Avatar")
Layout.fillWidth: true
}
Button {
text: qsTr("Choose")
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
onClicked: fileDialog.open()
}
Label { Label {
text: qsTr("Automatic login") text: qsTr("Automatic login")
Layout.fillWidth: true Layout.fillWidth: true
@ -158,7 +153,6 @@ Item {
leftPadding: 0 leftPadding: 0
rightPadding: 0 rightPadding: 0
onCheckedChanged: currentUser.automaticLogin = checked onCheckedChanged: currentUser.automaticLogin = checked
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Component.onCompleted: { Component.onCompleted: {
@ -171,9 +165,8 @@ Item {
text: qsTr("Delete this user") text: qsTr("Delete this user")
enabled: model.userId !== loggedUser.userId enabled: model.userId !== loggedUser.userId
onClicked: accountsManager.deleteUser(userId, true) onClicked: accountsManager.deleteUser(userId, true)
Layout.fillWidth: true
} }
HorizontalDivider {}
} }
} }
} }

Loading…
Cancel
Save