Move alpha management closer to screen level

Felt bad messing with alpha at the column level.
This commit is contained in:
Bartłomiej Dach
2022-05-08 15:13:29 +02:00
parent 38c004d734
commit 6bdcf893b7
2 changed files with 8 additions and 6 deletions

View File

@ -350,7 +350,6 @@ namespace osu.Game.Overlays.Mods
} }
allFiltered.Value = panelFlow.All(panel => panel.Filtered.Value); allFiltered.Value = panelFlow.All(panel => panel.Filtered.Value);
Alpha = allFiltered.Value ? 0 : 1;
if (toggleAllCheckbox != null && !SelectionAnimationRunning) if (toggleAllCheckbox != null && !SelectionAnimationRunning)
{ {

View File

@ -580,17 +580,20 @@ namespace osu.Game.Overlays.Mods
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
Active.BindValueChanged(_ => updateDim(), true); Active.BindValueChanged(_ => updateState());
Column.AllFiltered.BindValueChanged(_ => updateState(), true);
FinishTransforms(); FinishTransforms();
} }
protected override bool RequiresChildrenUpdate => base.RequiresChildrenUpdate || Column.SelectionAnimationRunning; protected override bool RequiresChildrenUpdate => base.RequiresChildrenUpdate || Column.SelectionAnimationRunning;
private void updateDim() private void updateState()
{ {
Colour4 targetColour; Colour4 targetColour;
if (Active.Value) Column.Alpha = Column.AllFiltered.Value ? 0 : 1;
if (Column.Active.Value)
targetColour = Colour4.White; targetColour = Colour4.White;
else else
targetColour = IsHovered ? colours.GrayC : colours.Gray8; targetColour = IsHovered ? colours.GrayC : colours.Gray8;
@ -609,14 +612,14 @@ namespace osu.Game.Overlays.Mods
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)
{ {
base.OnHover(e); base.OnHover(e);
updateDim(); updateState();
return Active.Value; return Active.Value;
} }
protected override void OnHoverLost(HoverLostEvent e) protected override void OnHoverLost(HoverLostEvent e)
{ {
base.OnHoverLost(e); base.OnHoverLost(e);
updateDim(); updateState();
} }
} }