Fix excessive line spacing in GroupBox popout layouts - #26
Conversation
Testing Notes (2026-04-11)Partial fix applied + additional fixes needed During testing with Additional fixes in this branch (uncommitted)
Remaining issueEven with all three fixes applied, the settings popup still shows extra vertical spacing between rows compared to the WPF version:  The spacing is most visible in the vertical What's been ruled out
This PR should be merged with the current fixes; the remaining spacing refinement can be tracked as a follow-up issue. |
GroupBox used a plain Grid as its ItemsPanel, which places all items in cell (0,0). In Avalonia, StretchItemContainer stretches each item's ContentPresenter to fill the entire Grid height, producing huge gaps between items. Change to a vertical StackPanel so items stack normally. Fixes #10 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…inding - Set FontSize="12" on LayoutControl to match WPF's Windows system font default (Segoe UI 9pt at 96 DPI); Avalonia Fluent theme defaults to 14px which makes pack content larger than pack designers intended - Set ClipToBounds="False" on ItemsControl and LayoutTransformControl to match WPF's default non-clipping behavior; pack makers use negative margins to intentionally overflow elements outside their containers - Fix ArrayPanel StackPanel orientation binding from unreliable RelativeSource (silently fails in Avalonia's ItemsPanelTemplate, always defaulting to Vertical) to direct DataContext binding which works correctly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
958fbc9 to
809cdb9
Compare
Summary
ItemsPanel:<Grid />→<StackPanel Orientation="Vertical" />— withStretchItemContainer, a plain Grid stretches each ContentPresenter to the full Grid height, producing huge gaps between itemsFontSize="12"on LayoutControl — Avalonia Fluent theme defaults to 14px; WPF inherits Windows system font (~12px). Pack designers built for WPF so Avalonia's larger default inflates row heightsClipToBounds="False"onItemsControlandLayoutTransformControl— WPF does not clip by default; pack makers use negative margins to overflow elements outside their containersRelativeSource AncestorType=ItemsControlsilently fails in Avalonia'sItemsPanelTemplate(panel not in visual tree yet), causing all arrays to default to Vertical orientation; fixed by binding directly to the inherited DataContextKnown remaining issue
Settings popup rows still show slightly more vertical spacing than the WPF version. Root cause not yet identified. Tracked in the PR comment below.
Test plan
🤖 Generated with Claude Code