1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 00:43:22 +08:00

Replace "Connected as _" in login form with a UserPanel

This commit is contained in:
DrabWeb 2017-05-24 00:23:48 -03:00
parent 4681beab5d
commit 247d8e9b21
3 changed files with 7 additions and 5 deletions

View File

@ -33,14 +33,14 @@ namespace osu.Desktop.VisualTests.Tests
Id = 3103765,
Country = new Country { FlagName = @"JP" },
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/3103765/5b012e13611d5761caa7e24fecb3d3a16e1cf48fc2a3032cfd43dd444af83d82.jpeg"
}),
}) { Width = 300 },
peppy = new UserPanel(new User
{
Username = @"peppy",
Id = 2,
Country = new Country { FlagName = @"AU" },
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/2/08cad88747c235a64fca5f1b770e100f120827ded1ffe3b66bfcd19c940afa65.jpeg"
}),
}) { Width = 300 },
},
});

View File

@ -12,6 +12,7 @@ using osu.Game.Graphics.UserInterface;
using osu.Game.Online.API;
using OpenTK;
using osu.Framework.Input;
using osu.Game.Users;
namespace osu.Game.Overlays.Settings.Sections.General
{
@ -71,11 +72,12 @@ namespace osu.Game.Overlays.Settings.Sections.General
};
break;
case APIState.Online:
UserPanel p;
Children = new Drawable[]
{
new OsuSpriteText
p = new UserPanel(api.LocalUser.Value)
{
Text = $"Connected as {api.Username}!",
RelativeSizeAxes = Axes.X,
},
new OsuButton
{
@ -84,6 +86,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
Action = api.Logout
}
};
p.Status.Value = new UserStatusOnline();
break;
}

View File

@ -30,7 +30,6 @@ namespace osu.Game.Users
public UserPanel(User user)
{
Width = 300;
Height = height;
Masking = true;
CornerRadius = 5;