mirror of
https://github.com/ppy/osu
synced 2025-02-21 13:07:18 +00:00
Use autosize instead of max width on fixed width timestamps
This commit is contained in:
parent
93f84ece0d
commit
b977fc8181
@ -191,7 +191,6 @@ namespace osu.Game.Online.Chat
|
|||||||
{
|
{
|
||||||
protected override float TextSize => 15;
|
protected override float TextSize => 15;
|
||||||
protected override float Spacing => 5;
|
protected override float Spacing => 5;
|
||||||
protected override float TimestampWidth => 45;
|
|
||||||
protected override float UsernameWidth => 75;
|
protected override float UsernameWidth => 75;
|
||||||
|
|
||||||
public StandAloneMessage(Message message)
|
public StandAloneMessage(Message message)
|
||||||
|
@ -48,8 +48,6 @@ namespace osu.Game.Overlays.Chat
|
|||||||
|
|
||||||
protected virtual float Spacing => 15;
|
protected virtual float Spacing => 15;
|
||||||
|
|
||||||
protected virtual float TimestampWidth => 60;
|
|
||||||
|
|
||||||
protected virtual float UsernameWidth => 130;
|
protected virtual float UsernameWidth => 130;
|
||||||
|
|
||||||
private Color4 usernameColour;
|
private Color4 usernameColour;
|
||||||
@ -93,38 +91,31 @@ namespace osu.Game.Overlays.Chat
|
|||||||
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
|
RowDimensions = new[] { new Dimension(GridSizeMode.AutoSize) },
|
||||||
ColumnDimensions = new[]
|
ColumnDimensions = new[]
|
||||||
{
|
{
|
||||||
new Dimension(GridSizeMode.Absolute, TimestampWidth + Spacing + UsernameWidth + Spacing),
|
new Dimension(GridSizeMode.AutoSize),
|
||||||
|
new Dimension(GridSizeMode.Absolute, Spacing + UsernameWidth + Spacing),
|
||||||
new Dimension(),
|
new Dimension(),
|
||||||
},
|
},
|
||||||
Content = new[]
|
Content = new[]
|
||||||
{
|
{
|
||||||
new Drawable[]
|
new Drawable[]
|
||||||
{
|
{
|
||||||
new Container
|
timestamp = new OsuSpriteText
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
Shadow = false,
|
||||||
|
Anchor = Anchor.CentreLeft,
|
||||||
|
Origin = Anchor.CentreLeft,
|
||||||
|
Font = OsuFont.GetFont(size: TextSize * 0.75f, weight: FontWeight.SemiBold, fixedWidth: true),
|
||||||
|
Colour = colourProvider?.Background1 ?? Colour4.White,
|
||||||
|
AlwaysPresent = true,
|
||||||
|
},
|
||||||
|
new MessageSender(message.Sender)
|
||||||
|
{
|
||||||
|
Width = UsernameWidth,
|
||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Children = new Drawable[]
|
Origin = Anchor.TopRight,
|
||||||
{
|
Anchor = Anchor.TopRight,
|
||||||
timestamp = new OsuSpriteText
|
Child = createUsername(),
|
||||||
{
|
Margin = new MarginPadding { Horizontal = Spacing },
|
||||||
Shadow = false,
|
|
||||||
Anchor = Anchor.CentreLeft,
|
|
||||||
Origin = Anchor.CentreLeft,
|
|
||||||
Font = OsuFont.GetFont(size: TextSize * 0.75f, weight: FontWeight.SemiBold, fixedWidth: true),
|
|
||||||
MaxWidth = TimestampWidth,
|
|
||||||
Colour = colourProvider?.Background1 ?? Colour4.White,
|
|
||||||
},
|
|
||||||
new MessageSender(message.Sender)
|
|
||||||
{
|
|
||||||
Width = UsernameWidth,
|
|
||||||
AutoSizeAxes = Axes.Y,
|
|
||||||
Origin = Anchor.TopRight,
|
|
||||||
Anchor = Anchor.TopRight,
|
|
||||||
Child = createUsername(),
|
|
||||||
Margin = new MarginPadding { Horizontal = Spacing },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
ContentFlow = new LinkFlowContainer(t =>
|
ContentFlow = new LinkFlowContainer(t =>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user