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, Colour = Color4.White,
TextSize = 14, TextSize = 14,
LineHeight = 1, LineHeight = 1,
Margin = new MarginPadding { Horizontal = 10 } Padding = new MarginPadding { Horizontal = 10 },
Margin = new MarginPadding { Vertical = 5 },
}; };
public StandAloneDrawableChannel(Channel channel) public StandAloneDrawableChannel(Channel channel)

View File

@ -84,7 +84,8 @@ namespace osu.Game.Overlays.Chat
protected virtual DaySeparator CreateDaySeparator(DateTimeOffset time) => new DaySeparator(time) 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) 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 public float TextSize
{ {
@ -180,19 +181,22 @@ namespace osu.Game.Overlays.Chat
public DaySeparator(DateTimeOffset time) public DaySeparator(DateTimeOffset time)
{ {
Margin = new MarginPadding { Vertical = 10 };
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
Child = new GridContainer
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
ColumnDimensions = new[] ColumnDimensions = new[]
{ {
new Dimension(), new Dimension(),
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
new Dimension(), new Dimension(),
}; },
RowDimensions = new[] RowDimensions = new[]
{ {
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
}; },
Content = new[] Content = new[]
{ {
new Drawable[] new Drawable[]
@ -217,6 +221,7 @@ namespace osu.Game.Overlays.Chat
Height = lineHeight, Height = lineHeight,
}, },
} }
}
}; };
} }
} }