fix(ui): manual modal dragging, maximize/restore icon, day-toggle style
- Drive modal title-bar dragging manually via pointer capture + Window.Position; Avalonia 12's BeginMoveDrag and VisualRoot-as-Window cast no longer work (VisualRoot is a TopLevelHost). Applies to ModalShell and WorktreeModalView. - Toggle the MainWindow maximize button between maximize/restore glyphs on WindowState changes (adds Icon.WinRestore geometry). - Add the ToggleButton.day-toggle style used by the Prime weekday picker row. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,21 @@ public partial class MainWindow : Window
|
||||
InitializeComponent();
|
||||
KeyDown += OnWindowKeyDown;
|
||||
DataContextChanged += OnDataContextChanged;
|
||||
UpdateMaxIcon();
|
||||
}
|
||||
|
||||
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
|
||||
{
|
||||
base.OnPropertyChanged(change);
|
||||
if (change.Property == WindowStateProperty)
|
||||
UpdateMaxIcon();
|
||||
}
|
||||
|
||||
private void UpdateMaxIcon()
|
||||
{
|
||||
var key = WindowState == WindowState.Maximized ? "Icon.WinRestore" : "Icon.WinMax";
|
||||
if (this.TryFindResource(key, out var geometry) && geometry is Geometry g)
|
||||
MaxIcon.Data = g;
|
||||
}
|
||||
|
||||
private void OnDataContextChanged(object? sender, EventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user