From 1a255fdf4818358f2478e674601a7fe6399ddce6 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 25 May 2017 19:47:18 +0900 Subject: [PATCH] Fix display order regression --- .../Sections/General/LoginSettings.cs | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs index 2c92e8653e..d8db44607a 100644 --- a/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/General/LoginSettings.cs @@ -28,6 +28,9 @@ namespace osu.Game.Overlays.Settings.Sections.General private LoginForm form; private OsuColour colours; + private UserPanel panel; + private UserDropdown dropdown; + public override RectangleF BoundingBox => bounding ? base.BoundingBox : RectangleF.Empty; public bool Bounding @@ -95,33 +98,6 @@ namespace osu.Game.Overlays.Settings.Sections.General }; break; case APIState.Online: - UserDropdown dropdown = new UserDropdown { RelativeSizeAxes = Axes.X }; - dropdown.Current.ValueChanged += newValue => - { - switch (newValue) - { - case UserAction.Online: - api.LocalUser.Value.Status.Value = new UserStatusOnline(); - dropdown.StatusColour = colours.Green; - break; - case UserAction.DoNotDisturb: - api.LocalUser.Value.Status.Value = new UserStatusDoNotDisturb(); - dropdown.StatusColour = colours.Red; - break; - case UserAction.AppearOffline: - api.LocalUser.Value.Status.Value = new UserStatusOffline(); - dropdown.StatusColour = colours.Gray7; - break; - case UserAction.SignOut: - api.Logout(); - break; - } - }; - dropdown.Current.TriggerChange(); - - UserPanel panel = new UserPanel(api.LocalUser.Value) { RelativeSizeAxes = Axes.X }; - panel.Status.BindTo(api.LocalUser.Value.Status); - Children = new Drawable[] { new FillFlowContainer @@ -150,11 +126,36 @@ namespace osu.Game.Overlays.Settings.Sections.General }, }, }, - panel, - dropdown, + panel = new UserPanel(api.LocalUser.Value) { RelativeSizeAxes = Axes.X }, + dropdown = new UserDropdown { RelativeSizeAxes = Axes.X }, }, }, }; + + panel.Status.BindTo(api.LocalUser.Value.Status); + + dropdown.Current.TriggerChange(); + dropdown.Current.ValueChanged += newValue => + { + switch (newValue) + { + case UserAction.Online: + api.LocalUser.Value.Status.Value = new UserStatusOnline(); + dropdown.StatusColour = colours.Green; + break; + case UserAction.DoNotDisturb: + api.LocalUser.Value.Status.Value = new UserStatusDoNotDisturb(); + dropdown.StatusColour = colours.Red; + break; + case UserAction.AppearOffline: + api.LocalUser.Value.Status.Value = new UserStatusOffline(); + dropdown.StatusColour = colours.Gray7; + break; + case UserAction.SignOut: + api.Logout(); + break; + } + }; break; }