Skip to content

Commit

Permalink
fix form editors and geometry (#3156)
Browse files Browse the repository at this point in the history
small fixes for form editors and geometry point editing
  • Loading branch information
PeterPetrik committed Mar 19, 2024
1 parent e81cc78 commit 0ffc2ff
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
7 changes: 4 additions & 3 deletions app/qml/form/editors/MMFormTextMultilineEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ MMBaseInput {
property bool _fieldRememberValueState: parent.fieldRememberValueState

property alias placeholderText: textArea.placeholderText
property alias text: textArea.text
property string text: _fieldValue === undefined || _fieldValueIsNull ? '' : _fieldValue

property int minimumRows: 3

Expand Down Expand Up @@ -76,7 +76,7 @@ MMBaseInput {
height: contentHeight + textArea.verticalPadding
width: parent.width

text: root._fieldValue === undefined || root._fieldValueIsNull ? '' : root._fieldValue
text: root.text
textFormat: root._fieldConfig['UseHtml'] ? TextEdit.RichText : TextEdit.PlainText

hoverEnabled: true
Expand All @@ -92,8 +92,9 @@ MMBaseInput {

onTextChanged: root.editorValueChanged( text, text === "" )

// Avoid Android's uncommited text
// Could in theory be fixed with `inputMethodComposing` TextInput property instead
onPreeditTextChanged: Qt.inputMethod.commit() // to avoid Android's uncommited text
onPreeditTextChanged: if ( __androidUtils.isAndroid ) Qt.inputMethod.commit()
}

FontMetrics {
Expand Down
2 changes: 1 addition & 1 deletion app/qml/form/editors/MMFormValueMapEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ MMDropdownInput {

on_FieldValueChanged: {

if ( _fieldValueIsNull ) {
if ( _fieldValueIsNull || _fieldValue === undefined ) {
text = ""
preselectedFeatures = []
}
Expand Down
2 changes: 1 addition & 1 deletion app/qml/form/editors/MMFormValueRelationEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ MMDropdownInput {

selectedFeatures: {
if ( internal.allowMultivalue ) {
root.preselectedFeatures = vrModel.convertFromQgisType( root._fieldValue, FeaturesModel.FeatureId )
root.preselectedFeatures = vrModel.convertFromQgisType( root._fieldValue, MM.FeaturesModel.FeatureId )
}
else {
root.preselectedFeatures = [root._fieldValue]
Expand Down
18 changes: 14 additions & 4 deletions app/qml/map/MMRecordingTools.qml
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,15 @@ Item {
}

MMToolbarButton {
text: qsTr( "Record" );
iconSource: __style.doneCircleIcon;
text: qsTr( "Record" )

iconSource: __style.doneCircleIcon
iconColor: __style.grassColor
onClicked: {
if ( mapTool.hasValidGeometry() )
{
// If we currently grab a point
if ( mapTool.state == MM.RecordingMapTool.Grab )
if ( mapTool.state === MM.RecordingMapTool.Grab )
{
mapTool.releaseVertex( crosshair.recordPoint )
}
Expand All @@ -277,7 +278,16 @@ Item {
iconSource: __style.doneCircleIcon;
iconColor: __style.forestColor
onClicked: {
mapTool.addPoint( crosshair.recordPoint )
if ( mapTool.state === MM.RecordingMapTool.Grab )
{
// editing existing point geometry
mapTool.releaseVertex( crosshair.recordPoint )
} else
{
// recording new point
mapTool.addPoint( crosshair.recordPoint )
}

let pair = mapTool.getFeatureLayerPair()
root.done( pair )
}
Expand Down

1 comment on commit 0ffc2ff

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.03.565311 just submitted!

Please sign in to comment.