mobile/dive-edit: use template components and theme colors

Another small step to make the dark theme at least marginally useful.
We now use our template components and add the necessary elements to have
consistent text color.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-05-18 07:43:11 -07:00
parent 58d97c571d
commit 99438121c4

View file

@ -134,11 +134,9 @@ Item {
id: editorDetails id: editorDetails
width: parent.width width: parent.width
columns: 2 columns: 2
Controls.Label { TemplateLabelSmall {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: qsTr("Dive number:") text: qsTr("Dive number:")
font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.textColor
} }
SsrfTextField { SsrfTextField {
id: txtNumber; id: txtNumber;
@ -146,27 +144,28 @@ Item {
flickable: detailsEditFlickable flickable: detailsEditFlickable
} }
Controls.Label { TemplateLabelSmall {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: qsTr("Date:") text: qsTr("Date:")
font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.textColor
} }
SsrfTextField { SsrfTextField {
id: txtDate; id: txtDate;
Layout.fillWidth: true Layout.fillWidth: true
flickable: detailsEditFlickable flickable: detailsEditFlickable
} }
Controls.Label { TemplateLabelSmall {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
text: qsTr("Location:") text: qsTr("Location:")
font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.textColor
} }
Controls.ComboBox { Controls.ComboBox {
id: locationBox id: locationBox
editable: true editable: true
flat: true flat: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
manager.locationList : null manager.locationList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -274,6 +273,11 @@ Item {
id: suitBox id: suitBox
editable: true editable: true
flat: true flat: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
manager.suitList : null manager.suitList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -295,6 +299,11 @@ Item {
Controls.ComboBox { Controls.ComboBox {
id: buddyBox id: buddyBox
editable: true editable: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
manager.buddyList : null manager.buddyList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -316,6 +325,11 @@ Item {
Controls.ComboBox { Controls.ComboBox {
id: divemasterBox id: divemasterBox
editable: true editable: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
manager.divemasterList : null manager.divemasterList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -351,6 +365,11 @@ Item {
Controls.ComboBox { Controls.ComboBox {
id: cylinderBox0 id: cylinderBox0
flat: true flat: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
diveDetailsListView.currentItem.modelData.cylinderList : null diveDetailsListView.currentItem.modelData.cylinderList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -408,6 +427,11 @@ Item {
visible: usedCyl[1] != null ? true : false visible: usedCyl[1] != null ? true : false
id: cylinderBox1 id: cylinderBox1
flat: true flat: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
diveDetailsListView.currentItem.modelData.cylinderList : null diveDetailsListView.currentItem.modelData.cylinderList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -472,6 +496,11 @@ Item {
id: cylinderBox2 id: cylinderBox2
currentIndex: find(usedCyl[2]) currentIndex: find(usedCyl[2])
flat: true flat: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
diveDetailsListView.currentItem.modelData.cylinderList : null diveDetailsListView.currentItem.modelData.cylinderList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -535,6 +564,11 @@ Item {
id: cylinderBox3 id: cylinderBox3
currentIndex: find(usedCyl[3]) currentIndex: find(usedCyl[3])
flat: true flat: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
diveDetailsListView.currentItem.modelData.cylinderList : null diveDetailsListView.currentItem.modelData.cylinderList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -599,6 +633,11 @@ Item {
id: cylinderBox4 id: cylinderBox4
currentIndex: find(usedCyl[4]) currentIndex: find(usedCyl[4])
flat: true flat: true
contentItem: Text {
text: parent.displayText
color: subsurfaceTheme.textColor
verticalAlignment: Text.AlignVCenter
}
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
diveDetailsListView.currentItem.modelData.cylinderList : null diveDetailsListView.currentItem.modelData.cylinderList : null
inputMethodHints: Qt.ImhNoPredictiveText inputMethodHints: Qt.ImhNoPredictiveText
@ -657,7 +696,7 @@ Item {
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.textColor color: subsurfaceTheme.textColor
} }
Controls.SpinBox { TemplateSpinBox {
id: ratingPicker id: ratingPicker
from: 0 from: 0
to: 5 to: 5
@ -671,7 +710,7 @@ Item {
font.pointSize: subsurfaceTheme.smallPointSize font.pointSize: subsurfaceTheme.smallPointSize
color: subsurfaceTheme.textColor color: subsurfaceTheme.textColor
} }
Controls.SpinBox { TemplateSpinBox {
id: visibilityPicker id: visibilityPicker
from: 0 from: 0
to: 5 to: 5
@ -692,6 +731,7 @@ Item {
id: txtNotes id: txtNotes
textFormat: TextEdit.RichText textFormat: TextEdit.RichText
focus: true focus: true
color: subsurfaceTheme.textColor
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.minimumHeight: Kirigami.Units.gridUnit * 6 Layout.minimumHeight: Kirigami.Units.gridUnit * 6