diff --git a/osu.Game/Overlays/UserPage/UserPageHeader.cs b/osu.Game/Overlays/UserPage/UserPageHeader.cs new file mode 100644 index 0000000000..9982d18d07 --- /dev/null +++ b/osu.Game/Overlays/UserPage/UserPageHeader.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Overlays.UserPage +{ + public class UserPageHeader : Container + { + } +} diff --git a/osu.Game/Overlays/UserPage/UserPageSection.cs b/osu.Game/Overlays/UserPage/UserPageSection.cs new file mode 100644 index 0000000000..77202d6aef --- /dev/null +++ b/osu.Game/Overlays/UserPage/UserPageSection.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Graphics.Containers; +using osu.Game.Users; + +namespace osu.Game.Overlays.UserPage +{ + public abstract class UserPageSection : Container + { + protected readonly User User; + public abstract string Title { get; } + + protected UserPageSection(User user) + { + User = user; + } + } +} diff --git a/osu.Game/Overlays/UserPageOverlay.cs b/osu.Game/Overlays/UserPageOverlay.cs new file mode 100644 index 0000000000..1e0d672c22 --- /dev/null +++ b/osu.Game/Overlays/UserPageOverlay.cs @@ -0,0 +1,54 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using osu.Framework.Graphics.Containers; +using osu.Game.Graphics.Containers; +using osu.Game.Graphics.UserInterface; +using osu.Game.Overlays.UserPage; +using osu.Game.Users; + +namespace osu.Game.Overlays +{ + public class UserPageOverlay : FocusedOverlayContainer + { + private readonly User user; + private UserPageSection lastSection; + public UserPageOverlay(User user) + { + this.user = user; + var tab = new OsuTabControl(); + var sections = new UserPageSection[] { }; + var sectionsContainer = new SectionsContainer + { + ExpandableHeader = new UserPageHeader(), + FixedHeader = tab, + Sections = sections + }; + + Add(sectionsContainer); + + sectionsContainer.SelectedSection.ValueChanged += s => + { + if (lastSection != s) + { + lastSection = s as UserPageSection; + tab.Current.Value = lastSection; + } + }; + + tab.Current.ValueChanged += s => + { + if (lastSection != s) + { + lastSection = s; + sectionsContainer.ScrollContainer.ScrollIntoView(lastSection); + } + }; + } + } +} diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 98fb4b9707..3e2d86dfaa 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -85,6 +85,9 @@ + + +