1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 08:33:21 +08:00

Fix some margin/padding issues

This commit is contained in:
Andrei Zavatski 2019-10-22 01:45:04 +03:00
parent a3ab6d33c1
commit bb7af1e39c
2 changed files with 40 additions and 34 deletions

View File

@ -129,7 +129,8 @@ namespace osu.Game.Online.Chat
Colour = Color4.White,
TextSize = 14,
LineHeight = 1,
Margin = new MarginPadding { Horizontal = 10 }
Padding = new MarginPadding { Horizontal = 10 },
Margin = new MarginPadding { Vertical = 5 },
};
public StandAloneDrawableChannel(Channel channel)

View File

@ -84,7 +84,8 @@ namespace osu.Game.Overlays.Chat
protected virtual DaySeparator CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time)
{
Colour = colours.ChatBlue.Lighten(0.7f)
Margin = new MarginPadding { Vertical = 10 },
Colour = colours.ChatBlue.Lighten(0.7f),
};
private void newMessagesArrived(IEnumerable<Message> newMessages)
@ -158,7 +159,7 @@ namespace osu.Game.Overlays.Chat
}
}
protected class DaySeparator : GridContainer
protected class DaySeparator : Container
{
public float TextSize
{
@ -180,42 +181,46 @@ namespace osu.Game.Overlays.Chat
public DaySeparator(DateTimeOffset time)
{
Margin = new MarginPadding { Vertical = 10 };
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
ColumnDimensions = new[]
Child = new GridContainer
{
new Dimension(),
new Dimension(GridSizeMode.AutoSize),
new Dimension(),
};
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
};
Content = new[]
{
new Drawable[]
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
ColumnDimensions = new[]
{
leftBox = new Box
new Dimension(),
new Dimension(GridSizeMode.AutoSize),
new Dimension(),
},
RowDimensions = new[]
{
new Dimension(GridSizeMode.AutoSize),
},
Content = new[]
{
new Drawable[]
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Height = lineHeight,
},
text = new SpriteText
{
Margin = new MarginPadding { Horizontal = 10 },
Text = time.ToLocalTime().ToString("dd MMM yyyy"),
},
rightBox = new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Height = lineHeight,
},
leftBox = new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Height = lineHeight,
},
text = new SpriteText
{
Margin = new MarginPadding { Horizontal = 10 },
Text = time.ToLocalTime().ToString("dd MMM yyyy"),
},
rightBox = new Box
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
RelativeSizeAxes = Axes.X,
Height = lineHeight,
},
}
}
};
}