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 <you@example.com>
This commit is contained in:
@@ -25,7 +25,15 @@ public sealed partial class DefaultGameScreen : InGameScreen
|
|||||||
|
|
||||||
Chat.OnResized += ChatOnResized;
|
Chat.OnResized += ChatOnResized;
|
||||||
Chat.OnChatResizeFinish += ChatOnResizeFinish;
|
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 _)
|
private void ChatOnResizeFinish(Vector2 _)
|
||||||
|
|||||||
@@ -26,6 +26,14 @@ public sealed partial class SeparatedChatGameScreen : InGameScreen
|
|||||||
|
|
||||||
ScreenContainer.OnSplitResizeFinished += () =>
|
ScreenContainer.OnSplitResizeFinished += () =>
|
||||||
OnChatResized?.Invoke(new Vector2(ScreenContainer.SplitFraction, 0));
|
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<ChatBox>()!;
|
public override ChatBox ChatBox => GetWidget<ChatBox>()!;
|
||||||
|
|||||||
Reference in New Issue
Block a user