2021-07-06 06:20:58 +08:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
using System.IO;
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Graphics.UserInterface;
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
2024-09-27 12:57:05 +08:00
|
|
|
namespace osu.Game.Graphics.UserInterfaceV2.FileSelection
|
2021-07-06 06:20:58 +08:00
|
|
|
{
|
|
|
|
internal partial class OsuDirectorySelectorDirectory : DirectorySelectorDirectory
|
|
|
|
{
|
2024-08-27 22:01:49 +08:00
|
|
|
public OsuDirectorySelectorDirectory(DirectoryInfo directory, string? displayName = null)
|
2021-07-06 06:20:58 +08:00
|
|
|
: base(directory, displayName)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2024-08-27 21:59:42 +08:00
|
|
|
private void load(OsuColour colours)
|
2021-07-06 06:20:58 +08:00
|
|
|
{
|
|
|
|
Flow.AutoSizeAxes = Axes.X;
|
|
|
|
Flow.Height = OsuDirectorySelector.ITEM_HEIGHT;
|
|
|
|
|
2024-09-27 12:57:05 +08:00
|
|
|
AddInternal(new BackgroundLayer());
|
2024-08-27 21:59:42 +08:00
|
|
|
|
|
|
|
Colour = colours.Orange1;
|
2021-07-06 06:20:58 +08:00
|
|
|
}
|
|
|
|
|
2024-08-27 21:59:42 +08:00
|
|
|
protected override SpriteText CreateSpriteText() => new OsuSpriteText().With(t => t.Font = OsuFont.Default.With(weight: FontWeight.Bold));
|
2021-07-06 06:20:58 +08:00
|
|
|
|
|
|
|
protected override IconUsage? Icon => Directory.Name.Contains(Path.DirectorySeparatorChar)
|
|
|
|
? FontAwesome.Solid.Database
|
|
|
|
: FontAwesome.Regular.Folder;
|
|
|
|
}
|
|
|
|
}
|