fix: enforce min window size and pin navigation sidebar (#293)
Resolved conflict with current master, preserving navigation pane persistence while keeping the wider minimum size and dynamic pane width.\n\nValidation: local ARM64 build passed; Shared tests 1296 passed / 20 skipped; Tray tests 466 passed; remote CI green.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
adcccc9b56
commit
43873c1005
@ -5,7 +5,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:winex="using:WinUIEx"
|
||||
Title="OpenClaw"
|
||||
MinWidth="600" MinHeight="400">
|
||||
MinWidth="750" MinHeight="400">
|
||||
|
||||
<Window.SystemBackdrop>
|
||||
<MicaBackdrop/>
|
||||
|
||||
@ -83,10 +83,22 @@ public sealed partial class HubWindow : WindowEx
|
||||
this.CenterOnScreen();
|
||||
this.SetIcon(IconHelper.GetStatusIconPath(ConnectionStatus.Connected));
|
||||
|
||||
RootGrid.SizeChanged += OnRootGridSizeChanged;
|
||||
|
||||
// Don't select a nav item here — Settings/GatewayClient aren't set yet.
|
||||
// ShowHub() in App.xaml.cs calls NavigateToDefault() after setting properties.
|
||||
}
|
||||
|
||||
private void OnRootGridSizeChanged(object sender, SizeChangedEventArgs e)
|
||||
{
|
||||
const double minPane = 200;
|
||||
const double maxPane = 320;
|
||||
const double ratio = 0.25;
|
||||
|
||||
double desired = e.NewSize.Width * ratio;
|
||||
NavView.OpenPaneLength = Math.Clamp(desired, minPane, maxPane);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Navigate to the default page. Call after setting Settings/GatewayClient.
|
||||
/// </summary>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user