mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 06:42:56 +08:00
Expand click target of toolbar buttons and clock
This commit is contained in:
parent
e3ffea1b12
commit
724b4c9507
@ -63,6 +63,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
protected virtual Anchor TooltipAnchor => Anchor.TopLeft;
|
||||
|
||||
protected readonly Container ButtonContent;
|
||||
protected ConstrainedIconContainer IconContainer;
|
||||
protected SpriteText DrawableText;
|
||||
protected Box HoverBackground;
|
||||
@ -80,11 +81,16 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
protected ToolbarButton()
|
||||
{
|
||||
Width = Toolbar.HEIGHT;
|
||||
AutoSizeAxes = Axes.X;
|
||||
RelativeSizeAxes = Axes.Y;
|
||||
|
||||
Padding = new MarginPadding(3);
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
ButtonContent = new Container
|
||||
{
|
||||
Width = Toolbar.HEIGHT,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Padding = new MarginPadding(3),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
BackgroundContent = new Container
|
||||
@ -136,6 +142,8 @@ namespace osu.Game.Overlays.Toolbar
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tooltipContainer = new FillFlowContainer
|
||||
{
|
||||
Direction = FillDirection.Vertical,
|
||||
|
@ -42,8 +42,13 @@ namespace osu.Game.Overlays.Toolbar
|
||||
clockDisplayMode = config.GetBindable<ToolbarClockDisplayMode>(OsuSetting.ToolbarClockDisplayMode);
|
||||
prefer24HourTime = config.GetBindable<bool>(OsuSetting.Prefer24HourTime);
|
||||
|
||||
Padding = new MarginPadding(3);
|
||||
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
AutoSizeAxes = Axes.X,
|
||||
Padding = new MarginPadding(3),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new Container
|
||||
@ -91,6 +96,8 @@ namespace osu.Game.Overlays.Toolbar
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public ToolbarHomeButton()
|
||||
{
|
||||
Width *= 1.4f;
|
||||
ButtonContent.Width *= 1.4f;
|
||||
Hotkey = GlobalAction.Home;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
public ToolbarMusicButton()
|
||||
{
|
||||
Hotkey = GlobalAction.ToggleNowPlaying;
|
||||
AutoSizeAxes = Axes.X;
|
||||
ButtonContent.AutoSizeAxes = Axes.X;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
|
@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
public RulesetButton()
|
||||
{
|
||||
Padding = new MarginPadding(3)
|
||||
ButtonContent.Padding = new MarginPadding(3)
|
||||
{
|
||||
Bottom = 5
|
||||
};
|
||||
|
@ -10,7 +10,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public ToolbarSettingsButton()
|
||||
{
|
||||
Width *= 1.4f;
|
||||
ButtonContent.Width *= 1.4f;
|
||||
Hotkey = GlobalAction.ToggleSettings;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
|
||||
public ToolbarUserButton()
|
||||
{
|
||||
AutoSizeAxes = Axes.X;
|
||||
ButtonContent.AutoSizeAxes = Axes.X;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
Loading…
Reference in New Issue
Block a user