mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 12:57:39 +09:00
Remove fadeContainer and adjust fade condition
This commit is contained in:
parent
a8c31c31ad
commit
f9aa6b9c07
@ -26,7 +26,6 @@ namespace osu.Game.Overlays.Changelog
|
||||
|
||||
private readonly APIUpdateStream stream;
|
||||
|
||||
private Container fadeContainer;
|
||||
private FillFlowContainer<SpriteText> text;
|
||||
private ExpandingBar expandingBar;
|
||||
|
||||
@ -43,16 +42,10 @@ namespace osu.Game.Overlays.Changelog
|
||||
Padding = new MarginPadding(5);
|
||||
|
||||
AddRange(new Drawable[]
|
||||
{
|
||||
fadeContainer = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
text = new FillFlowContainer<SpriteText>
|
||||
{
|
||||
AutoSizeAxes = Axes.X,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
AutoSizeAxes = Axes.Both,
|
||||
Direction = FillDirection.Vertical,
|
||||
Margin = new MarginPadding { Top = 6 },
|
||||
Children = new[]
|
||||
@ -83,8 +76,6 @@ namespace osu.Game.Overlays.Changelog
|
||||
CollapsedSize = 2,
|
||||
IsCollapsed = true
|
||||
},
|
||||
}
|
||||
},
|
||||
new HoverClickSounds()
|
||||
});
|
||||
|
||||
@ -112,21 +103,23 @@ namespace osu.Game.Overlays.Changelog
|
||||
// Expand based on the local state
|
||||
bool shouldExpand = Active.Value || IsHovered;
|
||||
|
||||
bool allHighlighted = SelectedTab.Value == null && !externalDimRequested;
|
||||
|
||||
// Expand based on whether no build is selected and the badge area is hovered
|
||||
shouldExpand |= SelectedTab.Value == null && !externalDimRequested;
|
||||
shouldExpand |= allHighlighted;
|
||||
|
||||
if (shouldExpand)
|
||||
{
|
||||
expandingBar.Expand();
|
||||
fadeContainer.FadeTo(1, transition_duration);
|
||||
expandingBar.FadeTo(1, transition_duration, Easing.OutQuint);
|
||||
}
|
||||
else
|
||||
{
|
||||
expandingBar.Collapse();
|
||||
fadeContainer.FadeTo(0.5f, transition_duration);
|
||||
expandingBar.FadeTo(0.5f, transition_duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
text.FadeTo(externalDimRequested && !IsHovered ? 0.5f : 1, transition_duration);
|
||||
text.FadeTo(IsHovered || (Active.Value && !externalDimRequested) || allHighlighted ? 1 : 0.5f, transition_duration, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private bool externalDimRequested;
|
||||
|
Loading…
x
Reference in New Issue
Block a user