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:
mika kuns
2026-06-02 17:02:56 +02:00
parent 26998f05ff
commit f1715a34fa
6 changed files with 99 additions and 7 deletions

View File

@@ -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)