mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Make the progressButton use signals instead of functions
Although the naming is still a bit off, it's much cleaner to use signals instead of functions. It's also more in line with how default QML components handle these kind of situations CURA-6006
This commit is contained in:
parent
838949dac7
commit
6a466c99b2
4 changed files with 19 additions and 26 deletions
|
@ -18,9 +18,9 @@ Item
|
|||
property var activeLabel: catalog.i18nc("@action:button", "Cancel")
|
||||
property var completeLabel: catalog.i18nc("@action:button", "Installed")
|
||||
|
||||
property var readyAction: null // Action when button is ready and clicked (likely install)
|
||||
property var activeAction: null // Action when button is active and clicked (likely cancel)
|
||||
property var completeAction: null // Action when button is complete and clicked (likely go to installed)
|
||||
signal readyAction() // Action when button is ready and clicked (likely install)
|
||||
signal activeAction() // Action when button is active and clicked (likely cancel)
|
||||
signal completeAction() // Action when button is complete and clicked (likely go to installed)
|
||||
|
||||
width: UM.Theme.getSize("toolbox_action_button").width
|
||||
height: UM.Theme.getSize("toolbox_action_button").height
|
||||
|
@ -47,15 +47,15 @@ Item
|
|||
{
|
||||
if (complete)
|
||||
{
|
||||
return completeAction()
|
||||
completeAction()
|
||||
}
|
||||
else if (active)
|
||||
{
|
||||
return activeAction()
|
||||
activeAction()
|
||||
}
|
||||
else
|
||||
{
|
||||
return readyAction()
|
||||
readyAction()
|
||||
}
|
||||
}
|
||||
style: ButtonStyle
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue