List setting deletion + minor changes

This commit is contained in:
Adsooi 2020-12-27 19:42:03 +01:00
parent a3ba0724ab
commit d48e4e844c
4 changed files with 26 additions and 5 deletions

View file

@ -71,6 +71,7 @@ MenuBar {
visible: Objects.types[modelData].createable()
height: visible ? implicitHeight : 0
icon.source: './icons/'+modelData+'.svg' // Default to dark version
icon.name: modelData
icon.color: sysPalette.windowText
onTriggered: {
Objects.createNewRegisteredObject(modelData)

View file

@ -90,7 +90,7 @@ Column {
TextField {
id: valueInput
height: parent.height
width: parent.width - x
width: parent.width - x - deleteButton.width - 5
validator: RegExpValidator {
regExp: control.valueRegexp
}
@ -117,6 +117,24 @@ Column {
}
}
}
Item {
width: 5
height: parent.height
}
Button {
id: deleteButton
width: visible ? parent.height : 0
height: width
icon.source: './icons/delete.svg'
icon.name: 'delete'
visible: !control.forbidAdding
onClicked: {
control.model.remove(index)
}
}
}
}

View file

@ -257,14 +257,14 @@ ListView {
id: dlgCustomProperties
Item {
height: customPropListDict.visible ? customPropListDict.height : 30
height: customPropComment.height + customPropText.height + customPropCheckBox.height + customPropCombo.height + customPropListDict.height
width: dlgProperties.width
property string label: Utils.camelCase2readable(modelData[0])
Text {
id: customPropComment
height: 30
width: parent.width
height: visible ? implicitHeight : 0
visible: modelData[0].startsWith('comment')
text: visible ? modelData[1].replace(/\{name\}/g, objEditor.obj.name) : ''
color: sysPalette.windowText
@ -298,6 +298,7 @@ ListView {
CheckBox {
id: customPropCheckBox
visible: modelData[1] == 'Boolean'
height: visible ? implicitHeight : 0
width: parent.width
text: parent.label
checked: visible ? objEditor.obj[modelData[0]] : false
@ -310,8 +311,8 @@ ListView {
ComboBoxSetting {
id: customPropCombo
height: 30
width: dlgProperties.width
height: visible ? implicitHeight : 0
label: parent.label
// True to select an object of type, false for enums.
property bool selectObjMode: paramTypeIn(modelData[1], ['ObjectType'])
@ -345,6 +346,7 @@ ListView {
ListSetting {
id: customPropListDict
width: parent.width
height: visible ? implicitHeight : 0
visible: paramTypeIn(modelData[1], ['List', 'Dict'])
label: parent.label
@ -401,6 +403,7 @@ ListView {
visible: Objects.types[modelData].createable()
height: visible ? implicitHeight : 0
icon.source: './icons/'+modelData+'.svg' // Default to dark version
icon.name: modelData
icon.color: sysPalette.windowText
onClicked: {

View file

@ -120,7 +120,6 @@ class Sequence extends Expression {
}
var expr = parser.parse(str).simplify()
if(expr.evaluate(evalVariables) == 0) expr = parser.parse('0')
console.log(n, expr.toString())
expr = parser.parse(Utils.simplifyExpression(expr.toString())).simplify()
this.calcValues[n] = expr
}