diff --git a/src/qml/FeatureForm.qml b/src/qml/FeatureForm.qml index 696ddebdab..5dd77101c8 100644 --- a/src/qml/FeatureForm.qml +++ b/src/qml/FeatureForm.qml @@ -48,6 +48,7 @@ Page { } } + clip: true states: [ State { name: 'ReadOnly' diff --git a/src/qml/RelationCombobox.qml b/src/qml/RelationCombobox.qml index 3fb023cf7d..3427b1ca41 100644 --- a/src/qml/RelationCombobox.qml +++ b/src/qml/RelationCombobox.qml @@ -377,8 +377,11 @@ Item { property bool useCompleter: false property string completer: '' + anchors.verticalCenter: parent.verticalCenter + topPadding: 0 leftPadding: 5 rightPadding: 5 + bottomPadding: 0 width: parent.width - dropDownArrowCanvas.width - dropDownArrowCanvas.anchors.rightMargin * 2 height: fontMetrics.height + 12 text: useCompleter ? completer : comboBox.displayText @@ -398,8 +401,10 @@ Item { property string typedFilter: '' anchors.verticalCenter: parent.verticalCenter - padding: 5 - topPadding: fontMetrics.ascent - 1 + topPadding: 0 + rightPadding: 5 + leftPadding: 5 + bottomPadding: 0 topInset: 0 bottomInset: 0 width: parent.width - dropDownArrowCanvas.width - dropDownArrowCanvas.anchors.rightMargin * 2 @@ -420,14 +425,16 @@ Item { onDisplayTextChanged: { if (activeFocus) { if (text != comboBox.displayText) { - var trimmedText = text.trim(); + var trimmedText = text.trim() var matches = featureListModel.findDisplayValueMatches(trimmedText) if (matches.length > 0) { var remainder = featureListModel.dataFromRowIndex(matches[0], featureListModel.DisplayStringRole).substring(trimmedText.length) searchableLabel.completer = '' + trimmedText + '' + remainder + '' + color = Theme.mainTextColor } else { searchableLabel.completer = '' + color = Theme.warningColor } } else { searchableLabel.completer = '' @@ -441,24 +448,31 @@ Item { if (text === '') { if (!featureListModel.addNull || comboBox.currentIndex != 0) { text = comboBox.displayText - searchableLabel.completer = '' - } else { - searchableLabel.completer = '' + color = Theme.mainTextColor } + searchableLabel.completer = '' } } else { - if (text === '' && featureListModel.addNull) { - comboBox.currentIndex = 0; - searchableLabel.completer = comboBox.displayText - } else { - applyAutoCompletion(true) + if (!isLastKeyPressedReturn) { + if (text === '' && featureListModel.addNull) { + comboBox.currentIndex = 0; + searchableLabel.completer = comboBox.displayText + } else { + applyAutoCompletion(true) + } } } } + property bool isLastKeyPressedReturn: false Keys.onPressed: { if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) { - applyAutoCompletion() + if (!isLastKeyPressedReturn) { + applyAutoCompletion() + } + isLastKeyPressedReturn = true + } else { + isLastKeyPressedReturn = false } }