mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 22:43:25 +00:00
mobile/UI: small adjustments, using the slim combo box
This changes most readonly combo boxes to use the smaller, more modern looking TemplateSlimComboBox and makes some layout adjustments on a few pages to overall create a better UI. A lot of this is just cleaning up things that were rather rough in the first place. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
2784f390a1
commit
ee3482c109
3 changed files with 14 additions and 13 deletions
|
@ -386,17 +386,15 @@ Kirigami.ScrollablePage {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.leftMargin: Kirigami.Units.gridUnit / 2
|
anchors.leftMargin: Kirigami.Units.gridUnit / 2
|
||||||
anchors.rightMargin: Kirigami.Units.gridUnit / 2
|
anchors.rightMargin: Kirigami.Units.gridUnit / 2
|
||||||
TemplateComboBox {
|
TemplateSlimComboBox {
|
||||||
visible: filterBar.height === sitefilter.implicitHeight
|
visible: filterBar.height === sitefilter.implicitHeight
|
||||||
id: sitefilterMode
|
id: sitefilterMode
|
||||||
editable: false
|
|
||||||
model: ListModel {
|
model: ListModel {
|
||||||
ListElement {text: qsTr("Fulltext")}
|
ListElement {text: qsTr("Fulltext")}
|
||||||
ListElement {text: qsTr("People")}
|
ListElement {text: qsTr("People")}
|
||||||
ListElement {text: qsTr("Tags")}
|
ListElement {text: qsTr("Tags")}
|
||||||
}
|
}
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
Layout.preferredWidth: parent.width * 0.2
|
|
||||||
Layout.maximumWidth: parent.width * 0.3
|
Layout.maximumWidth: parent.width * 0.3
|
||||||
onActivated: {
|
onActivated: {
|
||||||
manager.setFilter(sitefilter.text, currentIndex)
|
manager.setFilter(sitefilter.text, currentIndex)
|
||||||
|
|
|
@ -12,7 +12,7 @@ Kirigami.ScrollablePage {
|
||||||
DiveSummaryModel { id: summaryModel }
|
DiveSummaryModel { id: summaryModel }
|
||||||
property string firstDive: ""
|
property string firstDive: ""
|
||||||
property string lastDive: ""
|
property string lastDive: ""
|
||||||
property int headerColumnWidth: Math.floor(width / 3)
|
property int headerColumnWidth: Math.floor((width - Kirigami.Units.gridUnit) / 3)
|
||||||
|
|
||||||
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
background: Rectangle { color: subsurfaceTheme.backgroundColor }
|
||||||
title: qsTr("Dive summary")
|
title: qsTr("Dive summary")
|
||||||
|
@ -83,12 +83,13 @@ Kirigami.ScrollablePage {
|
||||||
TemplateButton {
|
TemplateButton {
|
||||||
/* Replace by signals from the core in due course. */
|
/* Replace by signals from the core in due course. */
|
||||||
text: qsTr("Refresh")
|
text: qsTr("Refresh")
|
||||||
implicitWidth: headerColumnWidth
|
implicitWidth: headerColumnWidth - Kirigami.Units.largeSpacing
|
||||||
onClicked: reload()
|
onClicked: reload()
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateSlimComboBox {
|
||||||
id: selectionPrimary
|
id: selectionPrimary
|
||||||
editable: false
|
Layout.maximumWidth: headerColumnWidth - Kirigami.Units.largeSpacing
|
||||||
|
Layout.preferredWidth: headerColumnWidth - Kirigami.Units.largeSpacing
|
||||||
currentIndex: 0
|
currentIndex: 0
|
||||||
model: monthModel
|
model: monthModel
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
|
@ -96,9 +97,10 @@ Kirigami.ScrollablePage {
|
||||||
summaryModel.calc(0, currentIndex)
|
summaryModel.calc(0, currentIndex)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateSlimComboBox {
|
||||||
id: selectionSecondary
|
id: selectionSecondary
|
||||||
editable: false
|
Layout.maximumWidth: headerColumnWidth - Kirigami.Units.largeSpacing
|
||||||
|
Layout.preferredWidth: headerColumnWidth - Kirigami.Units.largeSpacing
|
||||||
currentIndex: 3
|
currentIndex: 3
|
||||||
model: monthModel
|
model: monthModel
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
|
@ -110,6 +112,7 @@ Kirigami.ScrollablePage {
|
||||||
Component {
|
Component {
|
||||||
id: rowDelegate
|
id: rowDelegate
|
||||||
Row {
|
Row {
|
||||||
|
Layout.leftMargin: 0
|
||||||
height: headerLabel.height + Kirigami.Units.largeSpacing
|
height: headerLabel.height + Kirigami.Units.largeSpacing
|
||||||
Rectangle {
|
Rectangle {
|
||||||
width: Kirigami.Units.gridUnit
|
width: Kirigami.Units.gridUnit
|
||||||
|
@ -131,7 +134,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
||||||
width: headerColumnWidth - 2 * Kirigami.Units.gridUnit
|
width: headerColumnWidth - 1.5 * Kirigami.Units.gridUnit
|
||||||
height: headerLabel.height + Kirigami.Units.largeSpacing
|
height: headerLabel.height + Kirigami.Units.largeSpacing
|
||||||
Label {
|
Label {
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
|
@ -141,7 +144,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
color: index & 1 ? subsurfaceTheme.backgroundColor : subsurfaceTheme.lightPrimaryColor
|
||||||
width: headerColumnWidth - 2 * Kirigami.Units.gridUnit
|
width: headerColumnWidth - 1.5 * Kirigami.Units.gridUnit
|
||||||
height: headerLabel.height + Kirigami.Units.largeSpacing
|
height: headerLabel.height + Kirigami.Units.largeSpacing
|
||||||
Label {
|
Label {
|
||||||
color: subsurfaceTheme.textColor
|
color: subsurfaceTheme.textColor
|
||||||
|
|
|
@ -81,7 +81,7 @@ TemplatePage {
|
||||||
TemplateLabel {
|
TemplateLabel {
|
||||||
text: qsTr("Cylinder:")
|
text: qsTr("Cylinder:")
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateSlimComboBox {
|
||||||
id: defaultCylinderBox
|
id: defaultCylinderBox
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onActivated: {
|
onActivated: {
|
||||||
|
@ -145,7 +145,7 @@ TemplatePage {
|
||||||
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
|
Layout.bottomMargin: Kirigami.Units.largeSpacing / 2
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateSlimComboBox {
|
||||||
editable: false
|
editable: false
|
||||||
Layout.columnSpan: 2
|
Layout.columnSpan: 2
|
||||||
currentIndex: (subsurfaceTheme.currentTheme === "Blue") ? 0 :
|
currentIndex: (subsurfaceTheme.currentTheme === "Blue") ? 0 :
|
||||||
|
|
Loading…
Add table
Reference in a new issue