mirror of
https://github.com/ppy/osu.git
synced 2024-11-08 11:27:44 +08:00
Merge pull request #18691 from peppy/toolbar-scrolling-ruleset-selection
Allow scrolling overflow of ruleset buttons in the toolbar
This commit is contained in:
commit
54eb2083c0
@ -14,6 +14,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Framework.Input.Bindings;
|
using osu.Framework.Input.Bindings;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
|
|
||||||
namespace osu.Game.Overlays.Toolbar
|
namespace osu.Game.Overlays.Toolbar
|
||||||
@ -65,45 +66,115 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new ToolbarBackground(),
|
new ToolbarBackground(),
|
||||||
new FillFlowContainer
|
new GridContainer
|
||||||
{
|
{
|
||||||
Direction = FillDirection.Horizontal,
|
RelativeSizeAxes = Axes.Both,
|
||||||
RelativeSizeAxes = Axes.Y,
|
ColumnDimensions = new[]
|
||||||
AutoSizeAxes = Axes.X,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
{
|
||||||
new ToolbarSettingsButton(),
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
new ToolbarHomeButton
|
new Dimension(),
|
||||||
|
new Dimension(GridSizeMode.AutoSize)
|
||||||
|
},
|
||||||
|
Content = new[]
|
||||||
|
{
|
||||||
|
new Drawable[]
|
||||||
{
|
{
|
||||||
Action = () => OnHome?.Invoke()
|
new Container
|
||||||
|
{
|
||||||
|
Name = "Left buttons",
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
AutoSizeAxes = Axes.X,
|
||||||
|
Depth = float.MinValue,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Colour = OsuColour.Gray(0.1f),
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
AutoSizeAxes = Axes.X,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new ToolbarSettingsButton(),
|
||||||
|
new ToolbarHomeButton
|
||||||
|
{
|
||||||
|
Action = () => OnHome?.Invoke()
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Name = "Ruleset selector",
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new OsuScrollContainer(Direction.Horizontal)
|
||||||
|
{
|
||||||
|
ScrollbarVisible = false,
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Masking = false,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
rulesetSelector = new ToolbarRulesetSelector()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Colour = ColourInfo.GradientHorizontal(OsuColour.Gray(0.1f).Opacity(0), OsuColour.Gray(0.1f)),
|
||||||
|
Width = 50,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
new Container
|
||||||
|
{
|
||||||
|
Name = "Right buttons",
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
AutoSizeAxes = Axes.X,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new Box
|
||||||
|
{
|
||||||
|
Colour = OsuColour.Gray(0.1f),
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
},
|
||||||
|
new FillFlowContainer
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopRight,
|
||||||
|
Origin = Anchor.TopRight,
|
||||||
|
Direction = FillDirection.Horizontal,
|
||||||
|
RelativeSizeAxes = Axes.Y,
|
||||||
|
AutoSizeAxes = Axes.X,
|
||||||
|
Children = new Drawable[]
|
||||||
|
{
|
||||||
|
new ToolbarNewsButton(),
|
||||||
|
new ToolbarChangelogButton(),
|
||||||
|
new ToolbarRankingsButton(),
|
||||||
|
new ToolbarBeatmapListingButton(),
|
||||||
|
new ToolbarChatButton(),
|
||||||
|
new ToolbarSocialButton(),
|
||||||
|
new ToolbarWikiButton(),
|
||||||
|
new ToolbarMusicButton(),
|
||||||
|
//new ToolbarButton
|
||||||
|
//{
|
||||||
|
// Icon = FontAwesome.Solid.search
|
||||||
|
//},
|
||||||
|
userButton = new ToolbarUserButton(),
|
||||||
|
new ToolbarClock(),
|
||||||
|
new ToolbarNotificationButton(),
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rulesetSelector = new ToolbarRulesetSelector()
|
|
||||||
}
|
|
||||||
},
|
|
||||||
new FillFlowContainer
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
Direction = FillDirection.Horizontal,
|
|
||||||
RelativeSizeAxes = Axes.Y,
|
|
||||||
AutoSizeAxes = Axes.X,
|
|
||||||
Children = new Drawable[]
|
|
||||||
{
|
|
||||||
new ToolbarNewsButton(),
|
|
||||||
new ToolbarChangelogButton(),
|
|
||||||
new ToolbarRankingsButton(),
|
|
||||||
new ToolbarBeatmapListingButton(),
|
|
||||||
new ToolbarChatButton(),
|
|
||||||
new ToolbarSocialButton(),
|
|
||||||
new ToolbarWikiButton(),
|
|
||||||
new ToolbarMusicButton(),
|
|
||||||
//new ToolbarButton
|
|
||||||
//{
|
|
||||||
// Icon = FontAwesome.Solid.search
|
|
||||||
//},
|
|
||||||
userButton = new ToolbarUserButton(),
|
|
||||||
new ToolbarClock(),
|
|
||||||
new ToolbarNotificationButton(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -161,7 +161,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMouseDown(MouseDownEvent e) => true;
|
protected override bool OnMouseDown(MouseDownEvent e) => false;
|
||||||
|
|
||||||
protected override bool OnClick(ClickEvent e)
|
protected override bool OnClick(ClickEvent e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user