Merge pull request #2382 from alicevision/dev/pushButtonAttribute

[core/ui] Add support for PushButton attribute
This commit is contained in:
Fabien Castan 2024-05-17 20:11:40 +02:00 committed by GitHub
commit d9b4b26a69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 71 additions and 3 deletions

View file

@ -78,7 +78,7 @@ RowLayout {
var tooltip = ""
if (!object.validValue && object.desc.errorMessage !== "")
tooltip += "<i><b>Error: </b>" + Format.plainToHtml(object.desc.errorMessage) + "</i><br><br>"
tooltip += "<b>" + object.desc.name + "</b><br>" + Format.plainToHtml(object.desc.description)
tooltip += "<b>" + object.desc.name + "</b><br>" + Format.plainToHtml(object.description)
return tooltip
}
visible: parameterMA.containsMouse
@ -179,6 +179,8 @@ RowLayout {
sourceComponent: {
switch (attribute.type) {
case "PushButtonParam":
return pushButton_component
case "ChoiceParam":
return attribute.desc.exclusive ? comboBox_component : multiChoice_component
case "IntParam": return slider_component
@ -203,6 +205,17 @@ RowLayout {
}
}
Component {
id: pushButton_component
Button {
text: attribute.label
enabled: root.editable
onClicked: {
attribute.clicked()
}
}
}
Component {
id: textField_component
TextField {