1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 01:33:20 +08:00

Merge pull request #6220 from EVAST9919/fix-changelog-margin

Fix incorrect icon margin in ChangelogOverlay
This commit is contained in:
Dan Balasescu 2019-09-24 13:49:28 +09:00 committed by GitHub
commit ac1abfc9c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,7 @@ using osu.Game.Users;
using osuTK.Graphics;
using osu.Framework.Allocation;
using System.Net;
using osuTK;
namespace osu.Game.Overlays.Changelog
{
@ -67,22 +68,34 @@ namespace osu.Game.Overlays.Changelog
foreach (APIChangelogEntry entry in categoryEntries)
{
LinkFlowContainer title = new LinkFlowContainer
{
Direction = FillDirection.Full,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Margin = new MarginPadding { Vertical = 5 },
};
var entryColour = entry.Major ? colours.YellowLight : Color4.White;
title.AddIcon(entry.Type == ChangelogEntryType.Fix ? FontAwesome.Solid.Check : FontAwesome.Solid.Plus, t =>
LinkFlowContainer title;
Container titleContainer = new Container
{
t.Font = fontSmall;
t.Colour = entryColour;
t.Padding = new MarginPadding { Left = -17, Right = 5 };
});
AutoSizeAxes = Axes.Y,
RelativeSizeAxes = Axes.X,
Margin = new MarginPadding { Vertical = 5 },
Children = new Drawable[]
{
new SpriteIcon
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreRight,
Size = new Vector2(fontSmall.Size),
Icon = entry.Type == ChangelogEntryType.Fix ? FontAwesome.Solid.Check : FontAwesome.Solid.Plus,
Colour = entryColour,
Margin = new MarginPadding { Right = 5 },
},
title = new LinkFlowContainer
{
Direction = FillDirection.Full,
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
}
}
};
title.AddText(entry.Title, t =>
{
@ -139,7 +152,7 @@ namespace osu.Game.Overlays.Changelog
t.Colour = entryColour;
});
ChangelogEntries.Add(title);
ChangelogEntries.Add(titleContainer);
if (!string.IsNullOrEmpty(entry.MessageHtml))
{