mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
Simplify enabled check for install button
That code was a bit wordy there. Contributes to issue CURA-5035.
This commit is contained in:
parent
050d7ec5f1
commit
2291164a6d
1 changed files with 2 additions and 16 deletions
|
@ -66,7 +66,7 @@ Item
|
|||
}
|
||||
else
|
||||
{
|
||||
if ( toolbox.isDownloading && toolbox.activePackage == model )
|
||||
if (toolbox.isDownloading && toolbox.activePackage == model)
|
||||
{
|
||||
return catalog.i18nc("@action:button", "Cancel")
|
||||
}
|
||||
|
@ -76,21 +76,7 @@ Item
|
|||
}
|
||||
}
|
||||
}
|
||||
enabled:
|
||||
{
|
||||
if (installed)
|
||||
{
|
||||
return true
|
||||
}
|
||||
if ( toolbox.isDownloading )
|
||||
{
|
||||
return toolbox.activePackage == model ? true : false
|
||||
}
|
||||
else
|
||||
{
|
||||
return true
|
||||
}
|
||||
}
|
||||
enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) //Don't allow installing while another download is running.
|
||||
opacity: enabled ? 1.0 : 0.5
|
||||
style: ButtonStyle
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue