diff --git a/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml b/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml index 2c41678..fc54a84 100644 --- a/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml +++ b/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml @@ -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"> diff --git a/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs b/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs index fd592f8..6379483 100644 --- a/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs +++ b/src/OpenClaw.Tray.WinUI/Windows/HubWindow.xaml.cs @@ -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); + } + /// /// Navigate to the default page. Call after setting Settings/GatewayClient. ///