Fix toolbar sizing hackiness.

This commit is contained in:
Dean Herbert 2017-02-04 22:27:05 +09:00
parent 57d97ba2e9
commit 714c94b7a8
2 changed files with 3 additions and 9 deletions

View File

@ -101,7 +101,7 @@ namespace osu.Game.Overlays.Toolbar
tooltipContainer = new FlowContainer tooltipContainer = new FlowContainer
{ {
Direction = FlowDirection.VerticalOnly, Direction = FlowDirection.VerticalOnly,
AutoSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize
Anchor = Anchor.BottomLeft, Anchor = Anchor.BottomLeft,
Position = new Vector2(5, 5), Position = new Vector2(5, 5),
Alpha = 0, Alpha = 0,
@ -123,6 +123,7 @@ namespace osu.Game.Overlays.Toolbar
}; };
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;
AutoSizeAxes = Axes.X;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
@ -131,14 +132,6 @@ namespace osu.Game.Overlays.Toolbar
sampleClick = audio.Sample.Get(@"Menu/menuclick"); sampleClick = audio.Sample.Get(@"Menu/menuclick");
} }
protected override void Update()
{
base.Update();
//todo: find a way to avoid using this (autosize needs to be able to ignore certain drawables.. in this case the tooltip)
Size = new Vector2(Flow.DrawSize.X, 1);
}
protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true; protected override bool OnMouseDown(InputState state, MouseDownEventArgs args) => true;
protected override bool OnClick(InputState state) protected override bool OnClick(InputState state)

View File

@ -22,6 +22,7 @@ namespace osu.Game.Overlays.Toolbar
public ToolbarUserArea() public ToolbarUserArea()
{ {
RelativeSizeAxes = Axes.Y; RelativeSizeAxes = Axes.Y;
AutoSizeAxes = Axes.X;
Children = new Drawable[] { Children = new Drawable[] {
button = new ToolbarUserButton button = new ToolbarUserButton