From: godisdeadLOL <169250097+godisdeadLOL@users.noreply.github.com> Date: Mon, 2 Sep 2024 19:12:11 +0000 (+0300) Subject: Actions bar dynamic resizing (#31759) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a25132ed5dd4ba478ffde3cc87420daac52ed2e3;p=space-station-14.git Actions bar dynamic resizing (#31759) * action bar dynamic resizing * action bar dynamic resizing for separated style * decreased indent for separated style --------- Co-authored-by: YourUsername --- diff --git a/Content.Client/UserInterface/Screens/DefaultGameScreen.xaml.cs b/Content.Client/UserInterface/Screens/DefaultGameScreen.xaml.cs index 0fb1b7d507..12f8422aeb 100644 --- a/Content.Client/UserInterface/Screens/DefaultGameScreen.xaml.cs +++ b/Content.Client/UserInterface/Screens/DefaultGameScreen.xaml.cs @@ -25,7 +25,15 @@ public sealed partial class DefaultGameScreen : InGameScreen Chat.OnResized += ChatOnResized; Chat.OnChatResizeFinish += ChatOnResizeFinish; - Actions.ActionsContainer.Columns = 1; + + MainViewport.OnResized += ResizeActionContainer; + Inventory.OnResized += ResizeActionContainer; + } + + private void ResizeActionContainer() + { + float indent = Inventory.Size.Y + TopBar.Size.Y + 40; + Actions.ActionsContainer.MaxGridHeight = MainViewport.Size.Y - indent; } private void ChatOnResizeFinish(Vector2 _) diff --git a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs index 45a29e03f1..e04d377d32 100644 --- a/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs +++ b/Content.Client/UserInterface/Screens/SeparatedChatGameScreen.xaml.cs @@ -26,6 +26,14 @@ public sealed partial class SeparatedChatGameScreen : InGameScreen ScreenContainer.OnSplitResizeFinished += () => OnChatResized?.Invoke(new Vector2(ScreenContainer.SplitFraction, 0)); + + ViewportContainer.OnResized += ResizeActionContainer; + } + + private void ResizeActionContainer() + { + float indent = 20; + Actions.ActionsContainer.MaxGridWidth = ViewportContainer.Size.X - indent; } public override ChatBox ChatBox => GetWidget()!;