1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-17 13:42:56 +08:00
osu-lazer/osu.Game/Overlays/Dashboard/Home/News/NewsItemGroupPanel.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1.1 KiB
C#
Raw Normal View History

2020-08-07 17:59:45 +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.Collections.Generic;
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Online.API.Requests.Responses;
namespace osu.Game.Overlays.Dashboard.Home.News
{
2020-08-12 16:24:26 +08:00
public partial class NewsItemGroupPanel : HomePanel
2020-08-07 17:59:45 +08:00
{
private readonly List<APINewsPost> posts;
2020-08-12 16:24:26 +08:00
public NewsItemGroupPanel(List<APINewsPost> posts)
2020-08-07 17:59:45 +08:00
{
this.posts = posts;
}
[BackgroundDependencyLoader]
private void load()
{
Content.Padding = new MarginPadding { Vertical = 5 };
2020-08-12 16:24:26 +08:00
Child = new FillFlowContainer<NewsGroupItem>
2020-08-07 17:59:45 +08:00
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,
2020-08-12 16:24:26 +08:00
Children = posts.Select(p => new NewsGroupItem(p)).ToArray()
2020-08-07 17:59:45 +08:00
};
}
}
}