Fix sizings

This commit is contained in:
smoogipoo 2019-03-05 17:14:49 +09:00
parent 4764a771d0
commit d01ec59acb
2 changed files with 15 additions and 7 deletions

View File

@ -213,18 +213,18 @@ private void load(OsuColour colours)
if (SetInfo.OnlineInfo?.HasVideo ?? false)
{
statusContainer.Add(new IconPill(FontAwesome.fa_film));
statusContainer.Add(new IconPill(FontAwesome.fa_film) { IconSize = new Vector2(20) });
}
if (SetInfo.OnlineInfo?.HasStoryboard ?? false)
{
statusContainer.Add(new IconPill(FontAwesome.fa_image));
statusContainer.Add(new IconPill(FontAwesome.fa_image) { IconSize = new Vector2(20) });
}
statusContainer.Add(new BeatmapSetOnlineStatusPill
{
TextSize = 12,
TextPadding = new MarginPadding { Horizontal = 10, Vertical = 5 },
TextPadding = new MarginPadding { Horizontal = 10, Vertical = 4 },
Status = SetInfo.OnlineInfo?.Status ?? BeatmapSetOnlineStatus.None,
});
}

View File

@ -12,6 +12,14 @@ namespace osu.Game.Overlays.Direct
{
public class IconPill : CircularContainer
{
public Vector2 IconSize
{
get => iconContainer.Size;
set => iconContainer.Size = value;
}
private readonly Container iconContainer;
public IconPill(FontAwesome icon)
{
AutoSizeAxes = Axes.Both;
@ -25,16 +33,16 @@ public IconPill(FontAwesome icon)
Colour = Color4.Black,
Alpha = 0.5f,
},
new Container
iconContainer = new Container
{
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding(5),
Size = new Vector2(22),
Padding = new MarginPadding(5),
Child = new SpriteIcon
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.Both,
Icon = icon,
Size = new Vector2(12),
},
},
};