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:
@@ -2,7 +2,7 @@
|
|||||||
<BoxContainer Orientation="Vertical" HorizontalExpand="True" SizeFlagsStretchRatio="0.4">
|
<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" />
|
<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" />
|
<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">
|
<BoxContainer Name="ButtonContainer" Orientation="Vertical" VerticalExpand="True" SeparationOverride="5">
|
||||||
<!-- Target buttons get added here by code -->
|
<!-- Target buttons get added here by code -->
|
||||||
</BoxContainer>
|
</BoxContainer>
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls
|
|||||||
_searchText = args.Text;
|
_searchText = args.Text;
|
||||||
|
|
||||||
UpdateVisibleButtons();
|
UpdateVisibleButtons();
|
||||||
|
// Reset scroll bar so they can see the relevant results.
|
||||||
|
GhostScroll.SetScrollValue(Vector2.Zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user