Prevent checkbox from toggle on when column have no valid panels

This commit is contained in:
Cootz 2023-05-29 14:22:40 +03:00
parent e43c233b48
commit 22c6d6c526
1 changed files with 4 additions and 1 deletions

View File

@ -151,7 +151,10 @@ private void updateState()
if (toggleAllCheckbox != null && !SelectionAnimationRunning)
{
toggleAllCheckbox.Alpha = availableMods.Any(panel => panel.IsValid) ? 1 : 0;
toggleAllCheckbox.Current.Value = availableMods.Where(panel => panel.IsValid).All(panel => panel.Active.Value);
//Prevent checkbox from checking when column have on valid panels
if (availableMods.Any(panel => panel.IsValid))
toggleAllCheckbox.Current.Value = availableMods.Where(panel => panel.IsValid).All(panel => panel.Active.Value);
}
}