Reset ghost role menu scroll upon search (#30159)

Quality of life so it doesn't sit on your old spot anymore.
This commit is contained in:
metalgearsloth
2024-07-21 16:38:45 +10:00
committed by GitHub
parent 5cb0442b75
commit b41c6a28fe
2 changed files with 3 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
<BoxContainer Orientation="Vertical" HorizontalExpand="True" SizeFlagsStretchRatio="0.4">
<Button Name="GhostnadoButton" Text="{Loc 'ghost-target-window-warp-to-most-followed'}" HorizontalAlignment="Center" Margin="0 4" />
<LineEdit Name="SearchBar" PlaceHolder="Search" HorizontalExpand="True" Margin="0 4" />
<ScrollContainer VerticalExpand="True" HorizontalExpand="True" HScrollEnabled="False">
<ScrollContainer Name="GhostScroll" VerticalExpand="True" HorizontalExpand="True" HScrollEnabled="False">
<BoxContainer Name="ButtonContainer" Orientation="Vertical" VerticalExpand="True" SeparationOverride="5">
<!-- Target buttons get added here by code -->
</BoxContainer>

View File

@@ -90,6 +90,8 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
_searchText = args.Text;
UpdateVisibleButtons();
// Reset scroll bar so they can see the relevant results.
GhostScroll.SetScrollValue(Vector2.Zero);
}
}
}