mirror of
https://github.com/osukey/osukey.git
synced 2025-05-10 08:07:18 +09:00
Implement HomeShowMoreNewsPanel
This commit is contained in:
parent
76d35a7667
commit
cddd4f0a97
@ -52,7 +52,8 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
Slug = "2020-07-16-summer-theme-park-2020-voting-open",
|
Slug = "2020-07-16-summer-theme-park-2020-voting-open",
|
||||||
PublishedAt = DateTimeOffset.Now,
|
PublishedAt = DateTimeOffset.Now,
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
|
new HomeShowMoreNewsPanel()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
// 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.Collections.Generic;
|
||||||
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
|
using osu.Game.Graphics.Containers;
|
||||||
|
using osu.Game.Graphics.Sprites;
|
||||||
|
using osuTK.Graphics;
|
||||||
|
|
||||||
|
namespace osu.Game.Overlays.Dashboard.Home.News
|
||||||
|
{
|
||||||
|
public class HomeShowMoreNewsPanel : OsuHoverContainer
|
||||||
|
{
|
||||||
|
protected override IEnumerable<Drawable> EffectTargets => new[] { text };
|
||||||
|
|
||||||
|
[Resolved(canBeNull: true)]
|
||||||
|
private NewsOverlay overlay { get; set; }
|
||||||
|
|
||||||
|
private OsuSpriteText text;
|
||||||
|
|
||||||
|
public HomeShowMoreNewsPanel()
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X;
|
||||||
|
AutoSizeAxes = Axes.Y;
|
||||||
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader]
|
||||||
|
private void load(OverlayColourProvider colourProvider)
|
||||||
|
{
|
||||||
|
Child = new HomePanel
|
||||||
|
{
|
||||||
|
Child = text = new OsuSpriteText
|
||||||
|
{
|
||||||
|
Anchor = Anchor.Centre,
|
||||||
|
Origin = Anchor.Centre,
|
||||||
|
Margin = new MarginPadding { Vertical = 20 },
|
||||||
|
Text = "see more"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
IdleColour = colourProvider.Light1;
|
||||||
|
HoverColour = Color4.White;
|
||||||
|
|
||||||
|
Action = () =>
|
||||||
|
{
|
||||||
|
overlay?.ShowFrontPage();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user