Make NewsSidebar scrollable

This commit is contained in:
Andrei Zavatski 2021-05-19 15:22:55 +03:00
parent 16ffedde8a
commit 150ed01c62

View File

@ -9,6 +9,7 @@ using osu.Game.Online.API.Requests.Responses;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osuTK; using osuTK;
using System.Linq; using System.Linq;
using osu.Game.Graphics.Containers;
namespace osu.Game.Overlays.News.Sidebar namespace osu.Game.Overlays.News.Sidebar
{ {
@ -31,9 +32,31 @@ namespace osu.Game.Overlays.News.Sidebar
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4 Colour = colourProvider.Background4
}, },
new Box
{
RelativeSizeAxes = Axes.Y,
Width = OsuScrollContainer.SCROLL_BAR_HEIGHT,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Colour = colourProvider.Background3,
Alpha = 0.5f
},
new Container new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Right = -3 }, // Compensate for scrollbar margin
Child = new OsuScrollContainer
{
RelativeSizeAxes = Axes.Both,
Child = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Right = 3 }, // Addeded 3px back
Child = new Container
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding Padding = new MarginPadding
{ {
Vertical = 20, Vertical = 20,
@ -59,6 +82,9 @@ namespace osu.Game.Overlays.News.Sidebar
} }
} }
} }
}
}
}
}; };
} }