1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-08 18:13:22 +08:00

Rename bool and make property for legibility

This commit is contained in:
Dean Herbert 2020-03-02 19:51:06 +09:00
parent df4de4a090
commit 23068034b1
2 changed files with 14 additions and 13 deletions

View File

@ -100,7 +100,7 @@ namespace osu.Game.Overlays.Changelog
private void updateState() private void updateState()
{ {
if (SelectedTab.Value == null && !externalDimRequested) if (SelectedTab.Value == null && !allStreamsDimmed)
{ {
expandingBar.Expand(); expandingBar.Expand();
expandingBar.FadeTo(1, transition_duration, Easing.OutQuint); expandingBar.FadeTo(1, transition_duration, Easing.OutQuint);
@ -113,21 +113,22 @@ namespace osu.Game.Overlays.Changelog
expandingBar.IsCollapsed = !shouldExpand; expandingBar.IsCollapsed = !shouldExpand;
expandingBar.FadeTo(shouldExpand ? 1 : 0.5f, transition_duration, Easing.OutQuint); expandingBar.FadeTo(shouldExpand ? 1 : 0.5f, transition_duration, Easing.OutQuint);
text.FadeTo(IsHovered || (Active.Value && !externalDimRequested) ? 1 : 0.5f, transition_duration, Easing.OutQuint); text.FadeTo(IsHovered || (Active.Value && !allStreamsDimmed) ? 1 : 0.5f, transition_duration, Easing.OutQuint);
} }
private bool externalDimRequested; private bool allStreamsDimmed;
public void EnableDim() public bool AllStreamsDimmed
{ {
externalDimRequested = true; get => allStreamsDimmed;
set
{
if (value == allStreamsDimmed)
return;
allStreamsDimmed = value;
updateState(); updateState();
} }
public void DisableDim()
{
externalDimRequested = false;
updateState();
} }
} }
} }

View File

@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Changelog
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)
{ {
foreach (var streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>()) foreach (var streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>())
streamBadge.EnableDim(); streamBadge.AllStreamsDimmed = true;
return base.OnHover(e); return base.OnHover(e);
} }
@ -35,7 +35,7 @@ namespace osu.Game.Overlays.Changelog
protected override void OnHoverLost(HoverLostEvent e) protected override void OnHoverLost(HoverLostEvent e)
{ {
foreach (var streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>()) foreach (var streamBadge in TabContainer.Children.OfType<UpdateStreamBadge>())
streamBadge.DisableDim(); streamBadge.AllStreamsDimmed = false;
base.OnHoverLost(e); base.OnHoverLost(e);
} }