1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-21 19:32:55 +08:00

Use rounded button in settings sidebar

This commit is contained in:
Bartłomiej Dach 2021-10-10 20:32:56 +02:00
parent 21ee24ea6d
commit b30dd2d4ed
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497
6 changed files with 30 additions and 19 deletions

View File

@ -225,6 +225,11 @@ namespace osu.Game.Graphics
public readonly Color4 GrayE = Color4Extensions.FromHex(@"eee"); public readonly Color4 GrayE = Color4Extensions.FromHex(@"eee");
public readonly Color4 GrayF = Color4Extensions.FromHex(@"fff"); public readonly Color4 GrayF = Color4Extensions.FromHex(@"fff");
/// <summary>
/// Equivalent to <see cref="OverlayColourProvider.Pink"/>'s <see cref="OverlayColourProvider.Colour3"/>.
/// </summary>
public readonly Color4 Pink3 = Color4Extensions.FromHex(@"cc3378");
/// <summary> /// <summary>
/// Equivalent to <see cref="OverlayColourProvider.Blue"/>'s <see cref="OverlayColourProvider.Colour3"/>. /// Equivalent to <see cref="OverlayColourProvider.Blue"/>'s <see cref="OverlayColourProvider.Colour3"/>.
/// </summary> /// </summary>

View File

@ -1,15 +1,17 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Effects; using osu.Framework.Graphics.Effects;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osuTK; using osuTK;
namespace osu.Game.Graphics.UserInterfaceV2 namespace osu.Game.Graphics.UserInterfaceV2
{ {
public class RoundedButton : OsuButton public class RoundedButton : OsuButton, IFilterable
{ {
public override float Height public override float Height
{ {
@ -44,5 +46,14 @@ namespace osu.Game.Graphics.UserInterfaceV2
} }
private void updateCornerRadius() => Content.CornerRadius = DrawHeight / 2; private void updateCornerRadius() => Content.CornerRadius = DrawHeight / 2;
public virtual IEnumerable<string> FilterTerms => new[] { Text.ToString() };
public bool MatchingFilter
{
set => this.FadeTo(value ? 1 : 0);
}
public bool FilteringActive { get; set; }
} }
} }

View File

@ -14,10 +14,7 @@ namespace osu.Game.Overlays.Settings
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
BackgroundColour = colours.Pink; BackgroundColour = colours.Pink3;
Triangles.ColourDark = colours.PinkDark;
Triangles.ColourLight = colours.PinkLight;
} }
} }
} }

View File

@ -7,7 +7,6 @@ using osu.Framework.Allocation;
using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Graphics.UserInterface;
using osu.Game.Input.Bindings; using osu.Game.Input.Bindings;
using osu.Game.Rulesets; using osu.Game.Rulesets;
using osu.Game.Localisation; using osu.Game.Localisation;
@ -59,7 +58,7 @@ namespace osu.Game.Overlays.Settings.Sections.Input
} }
} }
public class ResetButton : DangerousTriangleButton public class ResetButton : DangerousSettingsButton
{ {
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -10,7 +10,6 @@ using osu.Framework.Localisation;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Collections; using osu.Game.Collections;
using osu.Game.Database; using osu.Game.Database;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation; using osu.Game.Localisation;
using osu.Game.Scoring; using osu.Game.Scoring;
using osu.Game.Skinning; using osu.Game.Skinning;
@ -21,15 +20,15 @@ namespace osu.Game.Overlays.Settings.Sections.Maintenance
{ {
protected override LocalisableString Header => "General"; protected override LocalisableString Header => "General";
private TriangleButton importBeatmapsButton; private SettingsButton importBeatmapsButton;
private TriangleButton importScoresButton; private SettingsButton importScoresButton;
private TriangleButton importSkinsButton; private SettingsButton importSkinsButton;
private TriangleButton importCollectionsButton; private SettingsButton importCollectionsButton;
private TriangleButton deleteBeatmapsButton; private SettingsButton deleteBeatmapsButton;
private TriangleButton deleteScoresButton; private SettingsButton deleteScoresButton;
private TriangleButton deleteSkinsButton; private SettingsButton deleteSkinsButton;
private TriangleButton restoreButton; private SettingsButton restoreButton;
private TriangleButton undeleteButton; private SettingsButton undeleteButton;
[BackgroundDependencyLoader(permitNulls: true)] [BackgroundDependencyLoader(permitNulls: true)]
private void load(BeatmapManager beatmaps, ScoreManager scores, SkinManager skins, [CanBeNull] CollectionManager collectionManager, [CanBeNull] StableImportManager stableImportManager, DialogOverlay dialogOverlay) private void load(BeatmapManager beatmaps, ScoreManager scores, SkinManager skins, [CanBeNull] CollectionManager collectionManager, [CanBeNull] StableImportManager stableImportManager, DialogOverlay dialogOverlay)

View File

@ -6,11 +6,11 @@ using System.Linq;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Cursor; using osu.Framework.Graphics.Cursor;
using osu.Framework.Localisation; using osu.Framework.Localisation;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterfaceV2;
namespace osu.Game.Overlays.Settings namespace osu.Game.Overlays.Settings
{ {
public class SettingsButton : TriangleButton, IHasTooltip public class SettingsButton : RoundedButton, IHasTooltip
{ {
public SettingsButton() public SettingsButton()
{ {