Merge branch 'master' into settings-filter-regression-fix-2

This commit is contained in:
Dean Herbert
2022-04-24 17:40:25 +09:00
committed by GitHub
27 changed files with 666 additions and 270 deletions

View File

@ -149,13 +149,11 @@ namespace osu.Game.Graphics.Containers
{
lastKnownScroll = null;
float fixedHeaderSize = FixedHeader?.BoundingBox.Height ?? 0;
// implementation similar to ScrollIntoView but a bit more nuanced.
float top = scrollContainer.GetChildPosInContent(target);
float bottomScrollExtent = scrollContainer.ScrollableExtent - fixedHeaderSize;
float scrollTarget = top - fixedHeaderSize - scrollContainer.DisplayableContent * scroll_y_centre;
float bottomScrollExtent = scrollContainer.ScrollableExtent;
float scrollTarget = top - scrollContainer.DisplayableContent * scroll_y_centre;
if (scrollTarget > bottomScrollExtent)
scrollContainer.ScrollToEnd();
@ -267,9 +265,13 @@ namespace osu.Game.Graphics.Containers
{
if (!Children.Any()) return;
var newMargin = originalSectionsMargin;
// if a fixed header is present, apply top padding for it
// to make the scroll container aware of its displayable area.
// (i.e. for page up/down to work properly)
scrollContainer.Padding = new MarginPadding { Top = FixedHeader?.LayoutSize.Y ?? 0 };
newMargin.Top += (headerHeight ?? 0);
var newMargin = originalSectionsMargin;
newMargin.Top += (ExpandableHeader?.LayoutSize.Y ?? 0);
newMargin.Bottom += (footerHeight ?? 0);
scrollContentContainer.Margin = newMargin;