mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
mobile/UI: ensure active input field stays visible
This reuses the logic we implemented in the SsrfTextField. Eventually we will need to clean up the inconsistent names for these elements. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
f503e5a9c2
commit
7ed32e3a49
2 changed files with 12 additions and 1 deletions
|
@ -164,6 +164,7 @@ Item {
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
id: locationBox
|
id: locationBox
|
||||||
|
flickable: detailsEditFlickable
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
manager.locationList : null
|
manager.locationList : null
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
@ -253,6 +254,7 @@ Item {
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
id: suitBox
|
id: suitBox
|
||||||
|
flickable: detailsEditFlickable
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
manager.suitList : null
|
manager.suitList : null
|
||||||
}
|
}
|
||||||
|
@ -263,6 +265,7 @@ Item {
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
id: buddyBox
|
id: buddyBox
|
||||||
|
flickable: detailsEditFlickable
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
manager.buddyList : null
|
manager.buddyList : null
|
||||||
}
|
}
|
||||||
|
@ -273,6 +276,7 @@ Item {
|
||||||
}
|
}
|
||||||
TemplateEditComboBox {
|
TemplateEditComboBox {
|
||||||
id: divemasterBox
|
id: divemasterBox
|
||||||
|
flickable: detailsEditFlickable
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
manager.divemasterList : null
|
manager.divemasterList : null
|
||||||
}
|
}
|
||||||
|
@ -295,6 +299,7 @@ Item {
|
||||||
}
|
}
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
id: cylinderBox0
|
id: cylinderBox0
|
||||||
|
flickable: detailsEditFlickable
|
||||||
flat: true
|
flat: true
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
diveDetailsListView.currentItem.modelData.cylinderList : null
|
diveDetailsListView.currentItem.modelData.cylinderList : null
|
||||||
|
@ -344,6 +349,7 @@ Item {
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
visible: usedCyl[1] != null ? true : false
|
visible: usedCyl[1] != null ? true : false
|
||||||
id: cylinderBox1
|
id: cylinderBox1
|
||||||
|
flickable: detailsEditFlickable
|
||||||
flat: true
|
flat: true
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
diveDetailsListView.currentItem.modelData.cylinderList : null
|
diveDetailsListView.currentItem.modelData.cylinderList : null
|
||||||
|
@ -399,6 +405,7 @@ Item {
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
visible: usedCyl[2] != null ? true : false
|
visible: usedCyl[2] != null ? true : false
|
||||||
id: cylinderBox2
|
id: cylinderBox2
|
||||||
|
flickable: detailsEditFlickable
|
||||||
currentIndex: find(usedCyl[2])
|
currentIndex: find(usedCyl[2])
|
||||||
flat: true
|
flat: true
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
|
@ -454,6 +461,7 @@ Item {
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
visible: usedCyl[3] != null ? true : false
|
visible: usedCyl[3] != null ? true : false
|
||||||
id: cylinderBox3
|
id: cylinderBox3
|
||||||
|
flickable: detailsEditFlickable
|
||||||
currentIndex: find(usedCyl[3])
|
currentIndex: find(usedCyl[3])
|
||||||
flat: true
|
flat: true
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
|
@ -510,6 +518,7 @@ Item {
|
||||||
TemplateComboBox {
|
TemplateComboBox {
|
||||||
visible: usedCyl[4] != null ? true : false
|
visible: usedCyl[4] != null ? true : false
|
||||||
id: cylinderBox4
|
id: cylinderBox4
|
||||||
|
flickable: detailsEditFlickable
|
||||||
currentIndex: find(usedCyl[4])
|
currentIndex: find(usedCyl[4])
|
||||||
flat: true
|
flat: true
|
||||||
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
model: diveDetailsListView.currentItem && diveDetailsListView.currentItem.modelData !== null ?
|
||||||
|
|
|
@ -10,6 +10,7 @@ ComboBox {
|
||||||
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
|
Layout.preferredHeight: Kirigami.Units.gridUnit * 2.5
|
||||||
inputMethodHints: Qt.ImhNoPredictiveText
|
inputMethodHints: Qt.ImhNoPredictiveText
|
||||||
font.pointSize: subsurfaceTheme.regularPointSize
|
font.pointSize: subsurfaceTheme.regularPointSize
|
||||||
|
property var flickable // used to ensure the combobox is visible on screen
|
||||||
delegate: ItemDelegate {
|
delegate: ItemDelegate {
|
||||||
width: cb.width
|
width: cb.width
|
||||||
contentItem: Text {
|
contentItem: Text {
|
||||||
|
@ -47,10 +48,11 @@ ComboBox {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
contentItem: TextField {
|
contentItem: SsrfTextField {
|
||||||
readOnly: !cb.editable
|
readOnly: !cb.editable
|
||||||
anchors.right: indicator.left
|
anchors.right: indicator.left
|
||||||
anchors.left: cb.left
|
anchors.left: cb.left
|
||||||
|
flickable: cb.flickable
|
||||||
leftPadding: Kirigami.Units.smallSpacing
|
leftPadding: Kirigami.Units.smallSpacing
|
||||||
rightPadding: Kirigami.Units.smallSpacing
|
rightPadding: Kirigami.Units.smallSpacing
|
||||||
text: readOnly ? cb.displayText : cb.editText
|
text: readOnly ? cb.displayText : cb.editText
|
||||||
|
|
Loading…
Add table
Reference in a new issue