diff options
author | Joakim Bygdell <j.bygdell@gmail.com> | 2018-02-11 12:06:27 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-03-19 12:01:14 -0700 |
commit | 9755650b3c0eb775d2b567ce239261e76e492270 (patch) | |
tree | 0642251ad44f922e5d3a2f53331cea68a73bdcac /mobile-widgets | |
parent | a2111a419839c46560e0e8436b5fba0a8c56e9a6 (diff) | |
download | subsurface-9755650b3c0eb775d2b567ce239261e76e492270.tar.gz |
QML UI: switch editing back to comboBox
The HintsTextEdit just doesn't feel natural and intuitive.
Edit, fixed rebase issues.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qml/DiveDetailsEdit.qml | 52 |
1 files changed, 34 insertions, 18 deletions
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml index 4895ef9d1..9ce637acd 100644 --- a/mobile-widgets/qml/DiveDetailsEdit.qml +++ b/mobile-widgets/qml/DiveDetailsEdit.qml @@ -11,18 +11,18 @@ Item { property int dive_id property int number property alias dateText: txtDate.text - property alias locationText: txtLocation.text + property alias locationText: txtLocation.editText property alias gpsText: txtGps.text property alias airtempText: txtAirTemp.text property alias watertempText: txtWaterTemp.text property alias suitIndex: suitBox.currentIndex - property alias suitText: suitBox.text + property alias suitText: suitBox.editText property alias buddyIndex: buddyBox.currentIndex - property alias buddyText: buddyBox.text + property alias buddyText: buddyBox.editText property alias divemasterIndex: divemasterBox.currentIndex - property alias divemasterText: divemasterBox.text + property alias divemasterText: divemasterBox.editText property alias cylinderIndex: cylinderBox.currentIndex - property alias cylinderText: cylinderBox.text + property alias cylinderText: cylinderBox.editText property alias notesText: txtNotes.text property alias durationText: txtDuration.text property alias depthText: txtDepth.text @@ -63,9 +63,14 @@ Item { diveDetailsPage.state = "view" // run the transition // apply the changes to the dive_table manager.commitChanges(dive_id, detailsEdit.dateText, detailsEdit.locationText, detailsEdit.gpsText, detailsEdit.durationText, - detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText, suitBox.text, buddyBox.text, - divemasterBox.text, detailsEdit.weightText, detailsEdit.notesText, detailsEdit.startpressureText, - detailsEdit.endpressureText, detailsEdit.gasmixText, cylinderBox.text, detailsEdit.rating, + detailsEdit.depthText, detailsEdit.airtempText, detailsEdit.watertempText, + suitBox.currentText != "" ? suitBox.currentText : suitBox.editText, + buddyBox.currentText != "" ? buddyBox.currentText : buddyBox.editText, + divemasterBox.currentText != "" ? divemasterBox.currentText : divemasterBox.editText, + detailsEdit.weightText, detailsEdit.notesText, detailsEdit.startpressureText, + detailsEdit.endpressureText, detailsEdit.gasmixText, + cylinderBox.currentText != "" ? cylinderBox.currentText : cylinderBox.editText, + detailsEdit.rating, detailsEdit.visibility) // trigger the profile to be redrawn QMLProfile.diveId = dive_id @@ -127,12 +132,15 @@ Item { text: qsTr("Location:") font.pointSize: subsurfaceTheme.smallPointSize } - HintsTextEdit { + Controls.ComboBox { id: txtLocation - model: manager.locationList + editable: true + flat: true + model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? + diveDetailsListView.currentItem.modelData.dive.locationList : null inputMethodHints: Qt.ImhNoPredictiveText Layout.fillWidth: true - onEditingFinished: { + onAccepted: { gpsText = manager.getGpsFromSiteName(text) } } @@ -223,9 +231,12 @@ Item { text: qsTr("Suit:") font.pointSize: subsurfaceTheme.smallPointSize } - HintsTextEdit { + Controls.ComboBox { id: suitBox - model: manager.suitList + editable: true + flat: true + model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? + manager.suitList : null inputMethodHints: Qt.ImhNoPredictiveText Layout.fillWidth: true } @@ -235,9 +246,11 @@ Item { text: qsTr("Buddy:") font.pointSize: subsurfaceTheme.smallPointSize } - HintsTextEdit { + Controls.ComboBox { id: buddyBox - model: manager.buddyList + editable: true + model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? + manager.buddyList : null inputMethodHints: Qt.ImhNoPredictiveText Layout.fillWidth: true } @@ -247,9 +260,11 @@ Item { text: qsTr("Divemaster:") font.pointSize: subsurfaceTheme.smallPointSize } - HintsTextEdit { + Controls.ComboBox { id: divemasterBox - model: manager.divemasterList + editable: true + model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? + manager.divemasterList : null inputMethodHints: Qt.ImhNoPredictiveText Layout.fillWidth: true } @@ -273,8 +288,9 @@ Item { text: qsTr("Cylinder:") font.pointSize: subsurfaceTheme.smallPointSize } - HintsTextEdit { + Controls.ComboBox { id: cylinderBox + editable: true model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? diveDetailsListView.currentItem.modelData.dive.cylinderList : null inputMethodHints: Qt.ImhNoPredictiveText |