diff --git a/osu-framework b/osu-framework index 1f770847b2..f47b7132ca 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1f770847b245e6d250e63e60c24e9e84131d15e7 +Subproject commit f47b7132ca5d579e7a4c011bbfa38a7bb6c91c6a diff --git a/osu.Desktop.VisualTests/Program.cs b/osu.Desktop.VisualTests/Program.cs index 1cfa440dd9..4dcfaff987 100644 --- a/osu.Desktop.VisualTests/Program.cs +++ b/osu.Desktop.VisualTests/Program.cs @@ -12,7 +12,7 @@ namespace osu.Framework.VisualTests [STAThread] public static void Main(string[] args) { - BasicGameHost host = Host.GetSuitableHost(); + BasicGameHost host = Host.GetSuitableHost(@"osu-visual-tests"); host.Add(new VisualTestGame()); host.Run(); } diff --git a/osu.Desktop/Program.cs b/osu.Desktop/Program.cs index fe7423924c..1421086054 100644 --- a/osu.Desktop/Program.cs +++ b/osu.Desktop/Program.cs @@ -13,7 +13,7 @@ namespace osu.Desktop [STAThread] public static void Main() { - BasicGameHost host = Host.GetSuitableHost(); + BasicGameHost host = Host.GetSuitableHost(@"osu"); host.Add(new OsuGame()); host.Run(); } diff --git a/osu.Game/GameModes/Menu/ButtonSystem.cs b/osu.Game/GameModes/Menu/ButtonSystem.cs index 1f0888d7ea..00cef96ec9 100644 --- a/osu.Game/GameModes/Menu/ButtonSystem.cs +++ b/osu.Game/GameModes/Menu/ButtonSystem.cs @@ -82,7 +82,7 @@ namespace osu.Game.GameModes.Menu buttonFlow = new FlowContainerWithOrigin { Anchor = Anchor.Centre, - Padding = new Vector2(-wedge_width, 0), + Spacing = new Vector2(-wedge_width, 0), Children = new Drawable[] { settingsButton = new Button(@"settings", @"options", FontAwesome.gear, new Color4(85, 85, 85, 255), OnSettings, -wedge_width, Key.O), diff --git a/osu.Game/Online/Chat/Display/ChannelDisplay.cs b/osu.Game/Online/Chat/Display/ChannelDisplay.cs index 1b8c4e743e..f4c4417cd3 100644 --- a/osu.Game/Online/Chat/Display/ChannelDisplay.cs +++ b/osu.Game/Online/Chat/Display/ChannelDisplay.cs @@ -47,7 +47,7 @@ namespace osu.Game.Online.Chat.Display Direction = FlowDirection.VerticalOnly, RelativeSizeAxes = Axes.X, LayoutEasing = EasingTypes.Out, - Padding = new Vector2(1, 1) + Spacing = new Vector2(1, 1) } } } diff --git a/osu.Game/Online/Chat/Display/ChatLine.cs b/osu.Game/Online/Chat/Display/ChatLine.cs index 125463e666..5dc8b7133a 100644 --- a/osu.Game/Online/Chat/Display/ChatLine.cs +++ b/osu.Game/Online/Chat/Display/ChatLine.cs @@ -9,6 +9,7 @@ using osu.Framework.Graphics.Drawables; using osu.Framework.Graphics.Sprites; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Graphics.Primitives; namespace osu.Game.Online.Chat.Display { @@ -54,10 +55,10 @@ namespace osu.Game.Online.Chat.Display } } }, - new PaddingContainer + new Container { RelativeSizeAxes = Axes.X, - Padding = new Padding { Left = padding + 10 }, + Padding = new MarginPadding { Left = padding + 10 }, Children = new Drawable[] { new SpriteText diff --git a/osu.Game/Overlays/ToolbarButton.cs b/osu.Game/Overlays/ToolbarButton.cs index 815f31590b..a6798d6582 100644 --- a/osu.Game/Overlays/ToolbarButton.cs +++ b/osu.Game/Overlays/ToolbarButton.cs @@ -10,6 +10,7 @@ using osu.Framework.Input; using osu.Game.Graphics; using OpenTK; using OpenTK.Graphics; +using osu.Framework.Graphics.Primitives; namespace osu.Game.Overlays { @@ -29,7 +30,6 @@ namespace osu.Game.Overlays set { DrawableText.Text = value; - paddingIcon.Alpha = string.IsNullOrEmpty(value) ? 0 : 1; } } @@ -55,110 +55,73 @@ namespace osu.Game.Overlays protected TextAwesome DrawableIcon; protected SpriteText DrawableText; protected Box HoverBackground; - private Drawable paddingLeft; - private Drawable paddingRight; - private Drawable paddingIcon; private FlowContainer tooltipContainer; private SpriteText tooltip1; private SpriteText tooltip2; - public new float Padding - { - get { return paddingLeft.Size.X; } - set - { - paddingLeft.Size = new Vector2(value, 1); - paddingRight.Size = new Vector2(value, 1); - tooltipContainer.Position = new Vector2(value, tooltipContainer.Position.Y); - } - } - public ToolbarButton() { - HoverBackground = new Box + Children = new Drawable[] { - RelativeSizeAxes = Axes.Both, - Additive = true, - Colour = new Color4(60, 60, 60, 255), - Alpha = 0, - }; - - DrawableIcon = new TextAwesome - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - }; - - DrawableText = new SpriteText - { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, - }; - - tooltipContainer = new FlowContainer - { - Direction = FlowDirection.VerticalOnly, - Anchor = Anchor.BottomLeft, - Position = new Vector2(0, -5), - Alpha = 0, - Children = new[] + HoverBackground = new Box { - tooltip1 = new SpriteText() + RelativeSizeAxes = Axes.Both, + Additive = true, + Colour = new Color4(60, 60, 60, 255), + Alpha = 0, + }, + new FlowContainer + { + Direction = FlowDirection.HorizontalOnly, + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Padding = new MarginPadding { Left = 5, Right = 5 }, + RelativeSizeAxes = Axes.Y, + Children = new Drawable[] { - TextSize = 22, + DrawableIcon = new TextAwesome + { + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + }, + DrawableText = new SpriteText + { + Margin = new MarginPadding { Left = 5 }, + Anchor = Anchor.CentreLeft, + Origin = Anchor.CentreLeft, + }, }, - tooltip2 = new SpriteText + }, + tooltipContainer = new FlowContainer + { + Direction = FlowDirection.VerticalOnly, + Anchor = Anchor.BottomLeft, + Position = new Vector2(5, -5), + Alpha = 0, + Children = new[] { - TextSize = 15 + tooltip1 = new SpriteText() + { + TextSize = 22, + }, + tooltip2 = new SpriteText + { + TextSize = 15 + } } } }; - paddingLeft = new Container { RelativeSizeAxes = Axes.Y }; - paddingRight = new Container { RelativeSizeAxes = Axes.Y }; - paddingIcon = new Container - { - Size = new Vector2(5, 0), - Alpha = 0 - }; - - Padding = 10; RelativeSizeAxes = Axes.Y; Size = new Vector2(WIDTH, 1); } - public override void Load() - { - base.Load(); - - Children = new Drawable[] - { - HoverBackground, - new FlowContainer - { - Direction = FlowDirection.HorizontalOnly, - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.Y, - Children = new Drawable[] - { - paddingLeft, - DrawableIcon, - paddingIcon, - DrawableText, - paddingRight - }, - }, - tooltipContainer - }; - } - protected override void Update() { base.Update(); //todo: find a way to avoid using this (autosize needs to be able to ignore certain drawables.. in this case the tooltip) - Size = new Vector2(WIDTH + DrawableText.Size.X, 1); + Size = new Vector2(WIDTH + (DrawableText.IsVisible ? DrawableText.Size.X : 0), 1); } protected override bool OnClick(InputState state)