mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:39:04 +08: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
@ -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…
x
Reference in New Issue
Block a user