Some UI improvements

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

@ -41,12 +41,12 @@ Dialog {
contentItem: ColumnLayout {
id: _mainLayout
spacing: FishUI.Units.largeSpacing
spacing: FishUI.Units.largeSpacing * 1.5
GridLayout {
columns: 2
columnSpacing: FishUI.Units.largeSpacing
rowSpacing: FishUI.Units.smallSpacing
columnSpacing: FishUI.Units.largeSpacing * 2
rowSpacing: FishUI.Units.smallSpacing * 2
Label {
text: qsTr("User name")
@ -96,6 +96,8 @@ Dialog {
id: accountTypeCombo
model: [qsTr("Standard"), qsTr("Administrator")]
Layout.fillWidth: true
topInset: 0
bottomInset: 0
}
}

@ -46,7 +46,7 @@ ItemPage {
ColumnLayout {
id: layout
anchors.fill: parent
anchors.bottomMargin: FishUI.Units.largeSpacing
// anchors.bottomMargin: FishUI.Units.largeSpacing
spacing: FishUI.Units.largeSpacing * 2
RoundedItem {
@ -110,14 +110,14 @@ ItemPage {
GridView {
id: accentColorView
height: itemSize + FishUI.Units.largeSpacing * 2
height: itemSize
Layout.fillWidth: true
cellWidth: height
cellHeight: height
interactive: false
model: ListModel {}
property var itemSize: 32
property var itemSize: 30 + FishUI.Units.largeSpacing * 2
Component.onCompleted: {
model.append({"accentColor": String(FishUI.Theme.blueColor)})
@ -128,21 +128,14 @@ ItemPage {
model.append({"accentColor": String(FishUI.Theme.orangeColor)})
}
delegate: Rectangle {
delegate: Item {
id: _accentColorItem
property bool checked: Qt.colorEqual(FishUI.Theme.highlightColor, accentColor)
property color currentColor: accentColor
width: accentColorView.itemSize + FishUI.Units.largeSpacing
width: GridView.view.itemSize
height: width
color: "transparent"
radius: width / 2
border.color: _mouseArea.pressed ? Qt.rgba(currentColor.r,
currentColor.g,
currentColor.b, 0.6)
: Qt.rgba(currentColor.r,
currentColor.g,
currentColor.b, 0.4)
border.width: checked ? 3 : _mouseArea.containsMouse ? 2 : 0
MouseArea {
id: _mouseArea
@ -152,26 +145,40 @@ ItemPage {
}
Rectangle {
width: 32
height: width
anchors.centerIn: parent
color: currentColor
anchors.fill: parent
anchors.margins: FishUI.Units.smallSpacing
color: "transparent"
radius: width / 2
Image {
anchors.centerIn: parent
width: parent.height * 0.5
height: width
sourceSize: Qt.size(width, height)
source: "qrc:/images/checked.svg"
visible: checked
ColorOverlay {
anchors.fill: parent
source: parent
color: FishUI.Theme.highlightedTextColor
opacity: 1
visible: true
border.color: _mouseArea.pressed ? Qt.rgba(currentColor.r,
currentColor.g,
currentColor.b, 0.6)
: Qt.rgba(currentColor.r,
currentColor.g,
currentColor.b, 0.4)
border.width: checked || _mouseArea.containsMouse ? 3 : 0
Rectangle {
anchors.fill: parent
anchors.margins: FishUI.Units.smallSpacing
color: currentColor
radius: width / 2
Image {
anchors.centerIn: parent
width: parent.height * 0.5
height: width
sourceSize: Qt.size(width, height)
source: "qrc:/images/checked.svg"
visible: checked
ColorOverlay {
anchors.fill: parent
source: parent
color: FishUI.Theme.highlightedTextColor
opacity: 1
visible: true
}
}
}
}

Loading…
Cancel
Save