1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-12 11:17:22 +08:00

Remove width specifications

This commit is contained in:
Dean Herbert 2019-07-29 02:47:26 +09:00
parent de8f502871
commit 663f34d3d8
3 changed files with 13 additions and 6 deletions

View File

@ -24,6 +24,7 @@ namespace osu.Game.Overlays.Chat.Tabs
Icon.Alpha = 0; Icon.Alpha = 0;
Text.Font = Text.Font.With(size: 45); Text.Font = Text.Font.With(size: 45);
Text.Truncate = false;
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -87,12 +87,16 @@ namespace osu.Game.Overlays.Chat.Tabs
}, },
Text = new OsuSpriteText Text = new OsuSpriteText
{ {
Margin = new MarginPadding(5),
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Text = value.ToString(), Text = value.ToString(),
Font = OsuFont.GetFont(size: 18), Font = OsuFont.GetFont(size: 18),
Width = 115f, Padding = new MarginPadding(5)
{
Left = LeftTextPadding,
Right = RightTextPadding,
},
RelativeSizeAxes = Axes.X,
Truncate = true, Truncate = true,
}, },
CloseButton = new TabCloseButton CloseButton = new TabCloseButton
@ -111,6 +115,10 @@ namespace osu.Game.Overlays.Chat.Tabs
}; };
} }
protected virtual float LeftTextPadding => 5;
protected virtual float RightTextPadding => IsRemovable ? 40 : 5;
protected virtual IconUsage DisplayIcon => FontAwesome.Solid.Hashtag; protected virtual IconUsage DisplayIcon => FontAwesome.Solid.Hashtag;
protected virtual bool ShowCloseOnHover => true; protected virtual bool ShowCloseOnHover => true;

View File

@ -62,12 +62,10 @@ namespace osu.Game.Overlays.Chat.Tabs
}); });
avatar.OnLoadComplete += d => d.FadeInFromZero(300, Easing.OutQuint); avatar.OnLoadComplete += d => d.FadeInFromZero(300, Easing.OutQuint);
Text.X = ChatOverlay.TAB_AREA_HEIGHT;
Text.Width = 100f;
} }
protected override float LeftTextPadding => base.LeftTextPadding + ChatOverlay.TAB_AREA_HEIGHT;
protected override bool ShowCloseOnHover => false; protected override bool ShowCloseOnHover => false;
protected override void FadeActive() protected override void FadeActive()