make jobs that dont use whitelist greyed out on whitelist panel (#1718)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas 2024-08-31 01:10:24 +00:00 committed by GitHub
parent feaea82b88
commit 32268c1a30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -18,11 +18,14 @@ public sealed partial class DepartmentWhitelistPanel : PanelContainer
RobustXamlLoader.Load(this);
var allWhitelisted = true;
var grey = Color.FromHex("#ccc");
foreach (var id in department.Roles)
{
var thisJob = id; // closure capturing funny
var button = new CheckBox();
button.Text = proto.Index(id).LocalizedName;
if (!proto.Index(id).Whitelisted)
button.Modulate = grey; // Let admins know whitelisting this job is only for futureproofing.
button.Pressed = whitelists.Contains(id);
button.OnPressed += _ => OnSetJob?.Invoke(thisJob, button.Pressed);
JobsContainer.AddChild(button);