From 8d91519d597421e98a891639dab13cd649481de7 Mon Sep 17 00:00:00 2001 From: default0 Date: Sun, 26 Feb 2017 21:32:43 +0100 Subject: [PATCH] Update usage of FlowContainer and its subclasses --- osu.Desktop/Overlays/VersionManager.cs | 7 ++++--- osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs | 3 +-- osu.Game/Beatmaps/Drawables/BeatmapPanel.cs | 7 +++---- osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs | 4 ++-- osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs | 2 +- osu.Game/Graphics/UserInterface/StarCounter.cs | 3 +-- osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs | 2 +- osu.Game/Online/Chat/Drawables/DrawableChannel.cs | 2 +- osu.Game/Overlays/NotificationManager.cs | 2 +- osu.Game/Overlays/Notifications/NotificationSection.cs | 6 +++--- osu.Game/Overlays/Options/OptionDropDown.cs | 2 +- osu.Game/Overlays/Options/OptionSlider.cs | 2 +- osu.Game/Overlays/Options/OptionsSection.cs | 3 +-- osu.Game/Overlays/Options/OptionsSubsection.cs | 5 ++--- osu.Game/Overlays/Options/Sections/EditorSection.cs | 3 ++- .../Overlays/Options/Sections/General/LoginOptions.cs | 3 +-- osu.Game/Overlays/Options/Sections/MaintenanceSection.cs | 3 ++- osu.Game/Overlays/Options/Sections/SkinSection.cs | 3 ++- osu.Game/Overlays/Options/Sidebar.cs | 2 +- osu.Game/Overlays/OptionsOverlay.cs | 4 ++-- osu.Game/Overlays/Pause/PauseOverlay.cs | 6 ++---- osu.Game/Overlays/Toolbar/Toolbar.cs | 4 ++-- osu.Game/Overlays/Toolbar/ToolbarButton.cs | 9 ++++----- osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs | 2 +- osu.Game/Screens/GameScreenWhiteBox.cs | 2 +- osu.Game/Screens/Menu/Button.cs | 2 +- osu.Game/Screens/Menu/ButtonSystem.cs | 5 ++--- osu.Game/Screens/Menu/Disclaimer.cs | 3 +-- osu.Game/Screens/Play/KeyCounterCollection.cs | 2 +- osu.Game/Screens/Play/PlayerLoader.cs | 2 +- osu.Game/Screens/Ranking/Results.cs | 2 +- osu.Game/Screens/Select/BeatmapInfoWedge.cs | 6 +++--- osu.Game/Screens/Select/FilterControl.cs | 8 +++----- osu.Game/Screens/Select/Footer.cs | 6 ++---- 34 files changed, 58 insertions(+), 69 deletions(-) diff --git a/osu.Desktop/Overlays/VersionManager.cs b/osu.Desktop/Overlays/VersionManager.cs index bdc8bc7e1a..245b52fc46 100644 --- a/osu.Desktop/Overlays/VersionManager.cs +++ b/osu.Desktop/Overlays/VersionManager.cs @@ -60,16 +60,15 @@ namespace osu.Desktop.Overlays new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Children = new Drawable[] { new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(5)), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Spacing = new Vector2(5), Children = new Drawable[] { new OsuSpriteText @@ -95,6 +94,8 @@ namespace osu.Desktop.Overlays }, new Sprite { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, Texture = textures.Get(@"Menu/dev-build-footer"), }, } diff --git a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs index 8f53041017..42868fffac 100644 --- a/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs +++ b/osu.Game.Modes.Osu/Objects/Drawables/HitExplosion.cs @@ -25,8 +25,7 @@ namespace osu.Game.Modes.Osu.Objects.Drawables AutoSizeAxes = Axes.Both; Origin = Anchor.Centre; - Direction = FlowDirections.Vertical; - Spacing = new Vector2(0, 2); + FlowStrategy = FlowStrategies.GetVerticalFlow(new Vector2(0, 2)); Position = (h?.StackedEndPosition ?? Vector2.Zero) + judgement.PositionOffset; Children = new Drawable[] diff --git a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs index 214712af72..def333a2c3 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapPanel.cs @@ -86,7 +86,7 @@ namespace osu.Game.Beatmaps.Drawables new FlowContainer { Padding = new MarginPadding(5), - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(), AutoSizeAxes = Axes.Both, Anchor = Anchor.CentreLeft, Origin = Anchor.CentreLeft, @@ -101,15 +101,14 @@ namespace osu.Game.Beatmaps.Drawables new FlowContainer { Padding = new MarginPadding { Left = 5 }, - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), AutoSizeAxes = Axes.Both, Children = new Drawable[] { new FlowContainer { - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(4, 0)), AutoSizeAxes = Axes.Both, - Spacing = new Vector2(4, 0), Children = new[] { new OsuSpriteText diff --git a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs index 8681259272..8b3faf59ce 100644 --- a/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs +++ b/osu.Game/Beatmaps/Drawables/BeatmapSetHeader.cs @@ -38,7 +38,7 @@ namespace osu.Game.Beatmaps.Drawables }, new FlowContainer { - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Padding = new MarginPadding { Top = 5, Left = 18, Right = 10, Bottom = 10 }, AutoSizeAxes = Axes.Both, Children = new[] @@ -112,7 +112,7 @@ namespace osu.Game.Beatmaps.Drawables new FlowContainer { Depth = -1, - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(), RelativeSizeAxes = Axes.Both, // This makes the gradient not be perfectly horizontal, but diagonal at a ~40° angle Shear = new Vector2(0.8f, 0), diff --git a/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs b/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs index c2eb1fbc69..a0a9bd7063 100644 --- a/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs +++ b/osu.Game/Graphics/UserInterface/OsuDropDownMenuItem.cs @@ -21,7 +21,7 @@ namespace osu.Game.Graphics.UserInterface { new FlowContainer { - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(), RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Children = new Drawable[] diff --git a/osu.Game/Graphics/UserInterface/StarCounter.cs b/osu.Game/Graphics/UserInterface/StarCounter.cs index d2ca2e72f7..a6f4186efc 100644 --- a/osu.Game/Graphics/UserInterface/StarCounter.cs +++ b/osu.Game/Graphics/UserInterface/StarCounter.cs @@ -73,8 +73,7 @@ namespace osu.Game.Graphics.UserInterface stars = new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirections.Horizontal, - Spacing = new Vector2(star_spacing), + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(star_spacing)), } }; diff --git a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs index 4ae3ae6e50..178a6b0bc8 100644 --- a/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs +++ b/osu.Game/Graphics/UserInterface/Volume/VolumeControl.cs @@ -39,7 +39,7 @@ namespace osu.Game.Graphics.UserInterface.Volume Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Margin = new MarginPadding { Left = 10, Right = 10, Top = 30, Bottom = 30 }, - Spacing = new Vector2(15, 0), + FlowStrategy = FlowStrategies.GetFillFlow(new Vector2(15, 0)), Children = new Drawable[] { volumeMeterMaster = new VolumeMeter("Master"), diff --git a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs index 84d15967e4..19df21ba8c 100644 --- a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs +++ b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs @@ -41,7 +41,7 @@ namespace osu.Game.Online.Chat.Drawables { flow = new FlowContainer { - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, Padding = new MarginPadding { Left = 20, Right = 20 } diff --git a/osu.Game/Overlays/NotificationManager.cs b/osu.Game/Overlays/NotificationManager.cs index 7172559a94..4e8c17a0f2 100644 --- a/osu.Game/Overlays/NotificationManager.cs +++ b/osu.Game/Overlays/NotificationManager.cs @@ -46,7 +46,7 @@ namespace osu.Game.Overlays { sections = new FlowContainer { - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, Children = new [] diff --git a/osu.Game/Overlays/Notifications/NotificationSection.cs b/osu.Game/Overlays/Notifications/NotificationSection.cs index e5a597e387..9dfe290fc3 100644 --- a/osu.Game/Overlays/Notifications/NotificationSection.cs +++ b/osu.Game/Overlays/Notifications/NotificationSection.cs @@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Notifications { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - Direction = FlowDirections.Vertical; + FlowStrategy = FlowStrategies.GetVerticalFlow(); Padding = new MarginPadding { @@ -91,7 +91,7 @@ namespace osu.Game.Overlays.Notifications { Bottom = 5 }, - Spacing = new Vector2(5, 0), + FlowStrategy = FlowStrategies.GetFillFlow(new Vector2(5, 0)), AutoSizeAxes = Axes.Both, Children = new Drawable[] { @@ -116,7 +116,7 @@ namespace osu.Game.Overlays.Notifications RelativeSizeAxes = Axes.X, LayoutDuration = 150, LayoutEasing = EasingTypes.OutQuart, - Spacing = new Vector2(3), + FlowStrategy = FlowStrategies.GetFillFlow(new Vector2(3)), } }); } diff --git a/osu.Game/Overlays/Options/OptionDropDown.cs b/osu.Game/Overlays/Options/OptionDropDown.cs index 2f88ab34ae..86556c4ac9 100644 --- a/osu.Game/Overlays/Options/OptionDropDown.cs +++ b/osu.Game/Overlays/Options/OptionDropDown.cs @@ -89,7 +89,7 @@ namespace osu.Game.Overlays.Options { Items = new KeyValuePair[0]; - Direction = FlowDirections.Vertical; + FlowStrategy = FlowStrategies.GetVerticalFlow(); RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Children = new Drawable[] diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 0e5d9f915c..482af3edbe 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Options public OptionSlider() { - Direction = FlowDirections.Vertical; + FlowStrategy = FlowStrategies.GetFillFlow(); RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; Padding = new MarginPadding { Right = 5 }; diff --git a/osu.Game/Overlays/Options/OptionsSection.cs b/osu.Game/Overlays/Options/OptionsSection.cs index 61cfa868ec..e8d2a8af17 100644 --- a/osu.Game/Overlays/Options/OptionsSection.cs +++ b/osu.Game/Overlays/Options/OptionsSection.cs @@ -61,8 +61,7 @@ namespace osu.Game.Overlays.Options FlowContent = new FlowContainer { Margin = new MarginPadding { Top = header_size + header_margin }, - Direction = FlowDirections.Vertical, - Spacing = new Vector2(0, 30), + FlowStrategy = FlowStrategies.GetVerticalFlow(new Vector2(0, 30)), AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, }, diff --git a/osu.Game/Overlays/Options/OptionsSubsection.cs b/osu.Game/Overlays/Options/OptionsSubsection.cs index 4d8be559a7..27f98f7211 100644 --- a/osu.Game/Overlays/Options/OptionsSubsection.cs +++ b/osu.Game/Overlays/Options/OptionsSubsection.cs @@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Options { RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; - Direction = FlowDirections.Vertical; + FlowStrategy = FlowStrategies.GetVerticalFlow(); AddInternal(new Drawable[] { new OsuSpriteText @@ -31,10 +31,9 @@ namespace osu.Game.Overlays.Options }, content = new FlowContainer { - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(new Vector2(0, 5)), RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Spacing = new Vector2(0, 5), }, }); } diff --git a/osu.Game/Overlays/Options/Sections/EditorSection.cs b/osu.Game/Overlays/Options/Sections/EditorSection.cs index 513d89c601..ba615cafd1 100644 --- a/osu.Game/Overlays/Options/Sections/EditorSection.cs +++ b/osu.Game/Overlays/Options/Sections/EditorSection.cs @@ -7,6 +7,7 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; +using osu.Framework.Graphics.Containers; namespace osu.Game.Overlays.Options.Sections { @@ -18,7 +19,7 @@ namespace osu.Game.Overlays.Options.Sections [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - FlowContent.Spacing = new Vector2(0, 5); + FlowContent.FlowStrategy = FlowStrategies.GetFillFlow(new Vector2(0, 5)); Children = new Drawable[] { new OsuCheckbox diff --git a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs index 34f42aac43..ab1142c564 100644 --- a/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs +++ b/osu.Game/Overlays/Options/Sections/General/LoginOptions.cs @@ -100,10 +100,9 @@ namespace osu.Game.Overlays.Options.Sections.General private void load(APIAccess api, OsuConfigManager config) { this.api = api; - Direction = FlowDirections.Vertical; + FlowStrategy = FlowStrategies.GetVerticalFlow(new Vector2(0, 5)); AutoSizeAxes = Axes.Y; RelativeSizeAxes = Axes.X; - Spacing = new Vector2(0, 5); Children = new Drawable[] { username = new OsuTextBox diff --git a/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs b/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs index b69e085e6b..0b48527bd0 100644 --- a/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs +++ b/osu.Game/Overlays/Options/Sections/MaintenanceSection.cs @@ -5,6 +5,7 @@ using osu.Framework.Graphics; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; +using osu.Framework.Graphics.Containers; namespace osu.Game.Overlays.Options.Sections { @@ -15,7 +16,7 @@ namespace osu.Game.Overlays.Options.Sections public MaintenanceSection() { - FlowContent.Spacing = new Vector2(0, 5); + FlowContent.FlowStrategy = FlowStrategies.GetFillFlow(new Vector2(0, 5)); Children = new Drawable[] { new OsuButton diff --git a/osu.Game/Overlays/Options/Sections/SkinSection.cs b/osu.Game/Overlays/Options/Sections/SkinSection.cs index 56dd9ca318..9bf977dc4e 100644 --- a/osu.Game/Overlays/Options/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Options/Sections/SkinSection.cs @@ -8,6 +8,7 @@ using osu.Game.Configuration; using osu.Game.Graphics; using osu.Game.Graphics.UserInterface; using OpenTK; +using osu.Framework.Graphics.Containers; namespace osu.Game.Overlays.Options.Sections { @@ -19,7 +20,7 @@ namespace osu.Game.Overlays.Options.Sections [BackgroundDependencyLoader] private void load(OsuConfigManager config) { - FlowContent.Spacing = new Vector2(0, 5); + FlowContent.FlowStrategy = FlowStrategies.GetFillFlow(new Vector2(0, 5)); Children = new Drawable[] { new OptionLabel { Text = "TODO: Skin preview textures" }, diff --git a/osu.Game/Overlays/Options/Sidebar.cs b/osu.Game/Overlays/Options/Sidebar.cs index 362c448807..7c90675295 100644 --- a/osu.Game/Overlays/Options/Sidebar.cs +++ b/osu.Game/Overlays/Options/Sidebar.cs @@ -40,7 +40,7 @@ namespace osu.Game.Overlays.Options Anchor = Anchor.CentreLeft, AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Direction = FlowDirections.Vertical + FlowStrategy = FlowStrategies.GetVerticalFlow(), } } }, diff --git a/osu.Game/Overlays/OptionsOverlay.cs b/osu.Game/Overlays/OptionsOverlay.cs index 6d47e628ea..79645134e0 100644 --- a/osu.Game/Overlays/OptionsOverlay.cs +++ b/osu.Game/Overlays/OptionsOverlay.cs @@ -77,7 +77,7 @@ namespace osu.Game.Overlays { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Children = new Drawable[] { @@ -98,7 +98,7 @@ namespace osu.Game.Overlays { AutoSizeAxes = Axes.Y, RelativeSizeAxes = Axes.X, - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Children = sections, } } diff --git a/osu.Game/Overlays/Pause/PauseOverlay.cs b/osu.Game/Overlays/Pause/PauseOverlay.cs index 12a193c0be..99732d09d9 100644 --- a/osu.Game/Overlays/Pause/PauseOverlay.cs +++ b/osu.Game/Overlays/Pause/PauseOverlay.cs @@ -104,8 +104,7 @@ namespace osu.Game.Overlays.Pause { RelativeSizeAxes = Axes.X, AutoSizeAxes = Axes.Y, - Direction = FlowDirections.Vertical, - Spacing = new Vector2(0f, 50f), + FlowStrategy = FlowStrategies.GetVerticalFlow(new Vector2(0, 50)), Origin = Anchor.Centre, Anchor = Anchor.Centre, Children = new Drawable[] @@ -113,8 +112,7 @@ namespace osu.Game.Overlays.Pause new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirections.Vertical, - Spacing = new Vector2(0f, 20f), + FlowStrategy = FlowStrategies.GetVerticalFlow(new Vector2(0, 20)), Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, Children = new Drawable[] diff --git a/osu.Game/Overlays/Toolbar/Toolbar.cs b/osu.Game/Overlays/Toolbar/Toolbar.cs index caed663c04..a2ce2d03cf 100644 --- a/osu.Game/Overlays/Toolbar/Toolbar.cs +++ b/osu.Game/Overlays/Toolbar/Toolbar.cs @@ -43,7 +43,7 @@ namespace osu.Game.Overlays.Toolbar new ToolbarBackground(), new FlowContainer { - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] @@ -63,7 +63,7 @@ namespace osu.Game.Overlays.Toolbar { Anchor = Anchor.TopRight, Origin = Anchor.TopRight, - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] diff --git a/osu.Game/Overlays/Toolbar/ToolbarButton.cs b/osu.Game/Overlays/Toolbar/ToolbarButton.cs index 9c3c1095a3..5431acec17 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarButton.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarButton.cs @@ -84,19 +84,18 @@ namespace osu.Game.Overlays.Toolbar }, Flow = new FlowContainer { - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(5)), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Padding = new MarginPadding { Left = Toolbar.HEIGHT / 2, Right = Toolbar.HEIGHT / 2 }, - Spacing = new Vector2(5), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, Children = new Drawable[] { DrawableIcon = new TextAwesome { - Anchor = Anchor.CentreLeft, - Origin = Anchor.CentreLeft, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, }, DrawableText = new OsuSpriteText { @@ -107,7 +106,7 @@ namespace osu.Game.Overlays.Toolbar }, tooltipContainer = new FlowContainer { - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), RelativeSizeAxes = Axes.Both, //stops us being considered in parent's autosize Anchor = (TooltipAnchor & Anchor.x0) > 0 ? Anchor.BottomLeft : Anchor.BottomRight, Origin = TooltipAnchor, diff --git a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs index b3d1d29ae9..3dfb3c0e4e 100644 --- a/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs +++ b/osu.Game/Overlays/Toolbar/ToolbarModeSelector.cs @@ -36,7 +36,7 @@ namespace osu.Game.Overlays.Toolbar { RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Padding = new MarginPadding { Left = padding, Right = padding }, diff --git a/osu.Game/Screens/GameScreenWhiteBox.cs b/osu.Game/Screens/GameScreenWhiteBox.cs index a172726e67..8d79d1e1b9 100644 --- a/osu.Game/Screens/GameScreenWhiteBox.cs +++ b/osu.Game/Screens/GameScreenWhiteBox.cs @@ -126,7 +126,7 @@ namespace osu.Game.Screens }, childModeButtons = new FlowContainer { - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Anchor = Anchor.TopRight, Origin = Anchor.TopRight, RelativeSizeAxes = Axes.Both, diff --git a/osu.Game/Screens/Menu/Button.cs b/osu.Game/Screens/Menu/Button.cs index b1e39c8a35..7398eb62e7 100644 --- a/osu.Game/Screens/Menu/Button.cs +++ b/osu.Game/Screens/Menu/Button.cs @@ -114,7 +114,7 @@ namespace osu.Game.Screens.Menu new OsuSpriteText { Shadow = true, - Direction = FlowDirections.Horizontal, + AllowMultiline = false, Anchor = Anchor.Centre, Origin = Anchor.Centre, TextSize = 16, diff --git a/osu.Game/Screens/Menu/ButtonSystem.cs b/osu.Game/Screens/Menu/ButtonSystem.cs index dad7490c69..ebfeaf5506 100644 --- a/osu.Game/Screens/Menu/ButtonSystem.cs +++ b/osu.Game/Screens/Menu/ButtonSystem.cs @@ -78,16 +78,15 @@ namespace osu.Game.Screens.Menu }, buttonFlow = new FlowContainerWithOrigin { - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(-WEDGE_WIDTH, 0)), Anchor = Anchor.Centre, AutoSizeAxes = Axes.Both, - Spacing = new Vector2(-WEDGE_WIDTH, 0), Children = new[] { settingsButton = new Button(@"settings", @"options", FontAwesome.fa_gear, new Color4(85, 85, 85, 255), () => OnSettings?.Invoke(), -WEDGE_WIDTH, Key.O), backButton = new Button(@"back", @"back", FontAwesome.fa_osu_left_o, new Color4(51, 58, 94, 255), onBack, -WEDGE_WIDTH), iconFacade = new Container //need a container to make the osu! icon flow properly. - { + { Size = new Vector2(0, BUTTON_AREA_HEIGHT) } }, diff --git a/osu.Game/Screens/Menu/Disclaimer.cs b/osu.Game/Screens/Menu/Disclaimer.cs index 56074dbdfd..7562b4e5f2 100644 --- a/osu.Game/Screens/Menu/Disclaimer.cs +++ b/osu.Game/Screens/Menu/Disclaimer.cs @@ -32,8 +32,7 @@ namespace osu.Game.Screens.Menu AutoSizeAxes = Axes.Both, Anchor = Anchor.Centre, Origin = Anchor.Centre, - Direction = FlowDirections.Vertical, - Spacing = new Vector2(0, 2), + FlowStrategy = FlowStrategies.GetVerticalFlow(new Vector2(0, 2)), Children = new Drawable[] { icon = new TextAwesome diff --git a/osu.Game/Screens/Play/KeyCounterCollection.cs b/osu.Game/Screens/Play/KeyCounterCollection.cs index 8e7f7558d7..fbd9514208 100644 --- a/osu.Game/Screens/Play/KeyCounterCollection.cs +++ b/osu.Game/Screens/Play/KeyCounterCollection.cs @@ -12,7 +12,7 @@ namespace osu.Game.Screens.Play { public KeyCounterCollection() { - Direction = FlowDirections.Horizontal; + FlowStrategy = FlowStrategies.GetHorizontalFlow(); AutoSizeAxes = Axes.Both; } diff --git a/osu.Game/Screens/Play/PlayerLoader.cs b/osu.Game/Screens/Play/PlayerLoader.cs index e84425fbee..f8447a3439 100644 --- a/osu.Game/Screens/Play/PlayerLoader.cs +++ b/osu.Game/Screens/Play/PlayerLoader.cs @@ -139,7 +139,7 @@ namespace osu.Game.Screens.Play AutoSizeAxes = Axes.Both, Origin = Anchor.TopCentre, Anchor = Anchor.TopCentre, - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Children = new Drawable[] { new OsuSpriteText diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 33c680e539..861cc63947 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -68,7 +68,7 @@ namespace osu.Game.Screens.Ranking new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Children = new Drawable[] { new OsuSpriteText diff --git a/osu.Game/Screens/Select/BeatmapInfoWedge.cs b/osu.Game/Screens/Select/BeatmapInfoWedge.cs index 7856d0b031..8d99048b88 100644 --- a/osu.Game/Screens/Select/BeatmapInfoWedge.cs +++ b/osu.Game/Screens/Select/BeatmapInfoWedge.cs @@ -125,7 +125,7 @@ namespace osu.Game.Screens.Select { Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Margin = new MarginPadding { Top = 10, Left = 25, Right = 10, Bottom = 20 }, AutoSizeAxes = Axes.Both, Children = new Drawable[] @@ -147,7 +147,7 @@ namespace osu.Game.Screens.Select new FlowContainer { Margin = new MarginPadding { Top = 10 }, - Direction = FlowDirections.Horizontal, + FlowStrategy = FlowStrategies.GetHorizontalFlow(), AutoSizeAxes = Axes.Both, Children = new [] { @@ -170,7 +170,7 @@ namespace osu.Game.Screens.Select new FlowContainer { Margin = new MarginPadding { Top = 20 }, - Spacing = new Vector2(40,0), + FlowStrategy = FlowStrategies.GetFillFlow(new Vector2(40, 0)), AutoSizeAxes = Axes.Both, Children = labels }, diff --git a/osu.Game/Screens/Select/FilterControl.cs b/osu.Game/Screens/Select/FilterControl.cs index 23a61459ea..2aee714233 100644 --- a/osu.Game/Screens/Select/FilterControl.cs +++ b/osu.Game/Screens/Select/FilterControl.cs @@ -44,7 +44,7 @@ namespace osu.Game.Screens.Select Anchor = Anchor.TopRight, Origin = Anchor.TopRight, Width = 0.4f, // TODO: InnerWidth property or something - Direction = FlowDirections.Vertical, + FlowStrategy = FlowStrategies.GetVerticalFlow(), Children = new Drawable[] { searchTextBox = new SearchTextBox { @@ -177,8 +177,7 @@ namespace osu.Game.Screens.Select new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirections.Horizontal, - Spacing = new Vector2(10, 0), + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(10, 0)), Children = new Drawable[] { new TabItem @@ -209,8 +208,7 @@ namespace osu.Game.Screens.Select new FlowContainer { AutoSizeAxes = Axes.Both, - Direction = FlowDirections.Horizontal, - Spacing = new Vector2(10, 0), + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(10, 0)), Origin = Anchor.TopRight, Anchor = Anchor.TopRight, Children = new Drawable[] diff --git a/osu.Game/Screens/Select/Footer.cs b/osu.Game/Screens/Select/Footer.cs index 05ed670673..31cea60cdd 100644 --- a/osu.Game/Screens/Select/Footer.cs +++ b/osu.Game/Screens/Select/Footer.cs @@ -98,15 +98,13 @@ namespace osu.Game.Screens.Select Position = new Vector2(BackButton.SIZE_EXTENDED.X + padding, 0), RelativeSizeAxes = Axes.Y, AutoSizeAxes = Axes.X, - Direction = FlowDirections.Horizontal, - Spacing = new Vector2(padding, 0), + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(padding, 0)), Children = new Drawable[] { buttons = new FlowContainer { - Direction = FlowDirections.Horizontal, - Spacing = new Vector2(0.2f, 0), + FlowStrategy = FlowStrategies.GetHorizontalFlow(new Vector2(0.2f, 0)), AutoSizeAxes = Axes.Both, } }