Expose header background for SectionsContainer.

This commit is contained in:
Huo Yaoyuan
2017-06-07 22:11:38 +08:00
parent 9f9107b847
commit e94d98fa84
4 changed files with 36 additions and 10 deletions

View File

@ -151,7 +151,6 @@ namespace osu.Game.Overlays
private class SettingsSectionsContainer : SectionsContainer
{
public SearchContainer SearchContainer;
private readonly Box headerBackground;
protected override Container<Drawable> CreateScrollContentContainer()
=> SearchContainer = new SearchContainer
@ -164,11 +163,11 @@ namespace osu.Game.Overlays
public SettingsSectionsContainer()
{
ScrollContainer.ScrollbarVisible = false;
Add(headerBackground = new Box
HeaderBackground = new Box
{
Colour = Color4.Black,
RelativeSizeAxes = Axes.X
});
RelativeSizeAxes = Axes.Both
};
}
protected override void UpdateAfterChildren()
@ -176,9 +175,7 @@ namespace osu.Game.Overlays
base.UpdateAfterChildren();
// no null check because the usage of this class is strict
headerBackground.Height = ExpandableHeader.LayoutSize.Y + FixedHeader.LayoutSize.Y;
headerBackground.Y = ExpandableHeader.Y;
headerBackground.Alpha = -ExpandableHeader.Y / ExpandableHeader.LayoutSize.Y * 0.5f;
HeaderBackground.Alpha = -ExpandableHeader.Y / ExpandableHeader.LayoutSize.Y * 0.5f;
}
}
}