Skip to content

Commit

Permalink
Merge pull request #4079 from uglide/fix_regression
Browse files Browse the repository at this point in the history
Fix regression in Value Editor
  • Loading branch information
uglide committed Apr 4, 2018
2 parents b7f6d57 + 210dec5 commit 5519ad0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 7 additions & 1 deletion src/qml/value-editor/editors/HashItemEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ AbstractEditor {
enabled: root.active || root.state !== "edit"
showFormatters: root.state == "edit"
objectName: "rdm_key_hash_text_field"

function validationRule(raw) {
return true;
}
}

function initEmpty() {
Expand All @@ -41,7 +45,9 @@ AbstractEditor {

function validateValue(callback) {
keyText.validate(function (keyTextValid) {
return callback(keyTextValid);
textArea.validate(function (textAreaValid) {
return callback(keyTextValid && textAreaValid);
});
});
}

Expand Down
11 changes: 8 additions & 3 deletions src/qml/value-editor/editors/MultilineEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ ColumnLayout
textView.textFormat = TextEdit.PlainText
}

function validationRule(raw)
{
return qmlUtils.binaryStringLength(raw) > 0
}

function validate(callback) {
loadRawValue(function (error, raw) {

Expand All @@ -34,7 +39,7 @@ ColumnLayout
return callback(false);
}

var valid = qmlUtils.binaryStringLength(raw) > 0
var valid = validationRule(raw)

if (valid) {
hideValidationError()
Expand Down Expand Up @@ -168,8 +173,7 @@ ColumnLayout
id: texteditorWrapper
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredHeight: 100
objectName: "rdm_key_multiline_text_field"
Layout.preferredHeight: 100

color: "white"
border.color: "#cccccc"
Expand All @@ -190,6 +194,7 @@ ColumnLayout
delegate:
NewTextArea {
id: textAreaPart
objectName: "rdm_key_multiline_text_field_" + index
width: textView.width
height: textAreaPart.contentHeight < texteditorWrapper.height? texteditorWrapper.height - 5 : textAreaPart.contentHeight

Expand Down

0 comments on commit 5519ad0

Please sign in to comment.