diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-12-30 12:22:18 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2021-01-01 11:35:39 -0800 |
commit | d6456d490fe8af39e9b9255071ae3e29db7f2dc3 (patch) | |
tree | 00a8def7cd91af0f46e84be012a2e0a9f0b0dc11 /mobile-widgets/qml/DiveDetailsEdit.qml | |
parent | 48c3e017d6b2c720e656b072d1be554bb73e3d89 (diff) | |
download | subsurface-d6456d490fe8af39e9b9255071ae3e29db7f2dc3.tar.gz |
mobile/UI: add template for editable combo box
This makes the code easier to read and manage.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/DiveDetailsEdit.qml')
-rw-r--r-- | mobile-widgets/qml/DiveDetailsEdit.qml | 48 |
1 files changed, 8 insertions, 40 deletions
diff --git a/mobile-widgets/qml/DiveDetailsEdit.qml b/mobile-widgets/qml/DiveDetailsEdit.qml index d885a54fd..d605d2919 100644 --- a/mobile-widgets/qml/DiveDetailsEdit.qml +++ b/mobile-widgets/qml/DiveDetailsEdit.qml @@ -154,14 +154,10 @@ Item { Layout.alignment: Qt.AlignRight text: qsTr("Location:") } - TemplateComboBox { + TemplateEditComboBox { id: locationBox - editable: true - flat: true model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? - manager.locationList : null - inputMethodHints: Qt.ImhNoPredictiveText - Layout.fillWidth: true + manager.locationList : null onAccepted: { focus = false gpsText = manager.getGpsFromSiteName(editText) @@ -261,20 +257,10 @@ Item { font.pointSize: subsurfaceTheme.smallPointSize color: subsurfaceTheme.textColor } - TemplateComboBox { + TemplateEditComboBox { id: suitBox - editable: true - flat: true model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? - manager.suitList : null - inputMethodHints: Qt.ImhNoPredictiveText - Layout.fillWidth: true - onActivated: { - focus = false - } - onAccepted: { - focus = false - } + manager.suitList : null } Controls.Label { @@ -283,19 +269,10 @@ Item { font.pointSize: subsurfaceTheme.smallPointSize color: subsurfaceTheme.textColor } - TemplateComboBox { + TemplateEditComboBox { id: buddyBox - editable: true model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? - manager.buddyList : null - inputMethodHints: Qt.ImhNoPredictiveText - Layout.fillWidth: true - onActivated: { - focus = false - } - onAccepted: { - focus = false - } + manager.buddyList : null } Controls.Label { @@ -304,19 +281,10 @@ Item { font.pointSize: subsurfaceTheme.smallPointSize color: subsurfaceTheme.textColor } - TemplateComboBox { + TemplateEditComboBox { id: divemasterBox - editable: true model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ? - manager.divemasterList : null - inputMethodHints: Qt.ImhNoPredictiveText - Layout.fillWidth: true - onActivated: { - focus = false - } - onAccepted: { - focus = false - } + manager.divemasterList : null } Controls.Label { |