mirror of
https://github.com/ppy/osu.git
synced 2025-03-04 06:12:57 +08:00
Fix searching in settings not correctly invalidating the scroll position
This commit is contained in:
parent
fc3fa4f241
commit
af0c7ed108
@ -170,13 +170,22 @@ namespace osu.Game.Graphics.Containers
|
|||||||
|
|
||||||
if (source == InvalidationSource.Child && (invalidation & Invalidation.DrawSize) != 0)
|
if (source == InvalidationSource.Child && (invalidation & Invalidation.DrawSize) != 0)
|
||||||
{
|
{
|
||||||
lastKnownScroll = null;
|
InvalidateScrollPosition();
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void InvalidateScrollPosition()
|
||||||
|
{
|
||||||
|
Schedule(() =>
|
||||||
|
{
|
||||||
|
lastKnownScroll = null;
|
||||||
|
lastClickedSection = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
protected override void UpdateAfterChildren()
|
protected override void UpdateAfterChildren()
|
||||||
{
|
{
|
||||||
base.UpdateAfterChildren();
|
base.UpdateAfterChildren();
|
||||||
|
@ -273,6 +273,16 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
public SearchContainer<SettingsSection> SearchContainer;
|
public SearchContainer<SettingsSection> SearchContainer;
|
||||||
|
|
||||||
|
public string SearchTerm
|
||||||
|
{
|
||||||
|
get => SearchContainer.SearchTerm;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
SearchContainer.SearchTerm = value;
|
||||||
|
InvalidateScrollPosition();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override FlowContainer<SettingsSection> CreateScrollContentContainer()
|
protected override FlowContainer<SettingsSection> CreateScrollContentContainer()
|
||||||
=> SearchContainer = new SearchContainer<SettingsSection>
|
=> SearchContainer = new SearchContainer<SettingsSection>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user