Skip to content

Commit

Permalink
FeatureForm style improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jul 6, 2016
1 parent 11b32b5 commit 9d16cb5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/qml/FeatureForm.qml
Expand Up @@ -59,12 +59,12 @@ Rectangle {
model: form.model

Item {
id: placeholder
Layout.row: index
Layout.column: 1
Layout.fillWidth: true
Layout.fillHeight: false

height: childrenRect.height
Layout.fillHeight: true
Layout.preferredHeight: childrenRect.height

Loader {
id: attributeEditorLoader
Expand All @@ -73,21 +73,22 @@ Rectangle {
enabled: form.state !== "ReadOnly"
property var value: AttributeValue
property var config: EditorWidgetConfig
property var widget: EditorWidget

source: 'editorwidgets/' + EditorWidget + '.qml'
source: 'editorwidgets/' + widget + '.qml'

onStatusChanged: {
if (attributeEditorLoader.status === Loader.Error )
{
console.warn( "Editor widget type '" + EditorWidget + "' not avaliable." )
EditorWidget = 'TextEdit'
widget = 'TextEdit'
}
}
}

Connections {
target: attributeEditorLoader.item
onValueChanged: featureFormList.model.setAttribute( index, value, FeatureModel.AttributeValue )
onValueChanged: form.model.setAttribute( index, value, FeatureModel.AttributeValue )
}
}
}
Expand All @@ -102,8 +103,7 @@ Rectangle {
Layout.fillHeight: false
checkedState: RememberValue

visible: form.state === "Add"
height: EditorWidget !== "Hidden"
visible: form.state === "Add" && EditorWidget !== "Hidden"

anchors.right: parent.right

Expand Down
2 changes: 2 additions & 0 deletions src/qml/editorwidgets/TextEdit.qml
Expand Up @@ -6,6 +6,7 @@ Item {
height: childrenRect.height

TextField {
id: textField
height: config['IsMultiline'] !== true ? undefined : 0
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -18,6 +19,7 @@ Item {
}

TextArea {
id: textArea
height: config['IsMultiline'] === true ? undefined : 0
anchors.left: parent.left
anchors.right: parent.right
Expand Down

0 comments on commit 9d16cb5

Please sign in to comment.