Skip to content

Pinned dockable sizing fixes#987

Merged
wieslawsoltes merged 4 commits intomasterfrom
PinnedDockableSizingFixes
Jan 16, 2026
Merged

Pinned dockable sizing fixes#987
wieslawsoltes merged 4 commits intomasterfrom
PinnedDockableSizingFixes

Conversation

@wieslawsoltes
Copy link
Owner

PR Summary

Overview

This change set fixes pinned dockable sizing regressions (shrink-on-toggle, size reset on re-open, incorrect initial size), prevents collapsed panel proportions from drifting, and adds tests to cover the new behavior.

Fixes and behavior changes

  • Preserve pinned dockable size across overlay show/hide by reapplying stored pinned bounds and avoiding overwrites when sizes are already valid.
  • Update pinned bounds only during splitter resize operations to stop layout passes from shrinking or resetting sizes.
  • Skip pinned bounds tracking for dockables hosted inside ToolPinItemControl so pin item visuals do not overwrite the pinned dock size.
  • Initialize pinned bounds from the current visible bounds (dockable first, then owner as fallback) when pinning, ensuring the initial pinned size reflects the active layout.
  • Prevent ProportionalStackPanel from overwriting CollapsedProportion when any child is collapsed, avoiding incremental shrink on repeated pin/unpin cycles.

Tests added/updated

  • ProportionalStackPanel: verify collapsed siblings do not reset stored collapsed proportions.
  • Factory pin bounds: validate pinned bounds initialization uses dockable visible bounds and falls back to owner bounds.
  • DockableControl tracking: assert pinned bounds update outside ToolPinItemControl and are ignored inside it.
  • PinnedDockControl: ensure stored width is reapplied after layout changes and pinned bounds update on resize.

Files touched

  • src/Dock.Controls.ProportionalStackPanel/Internal/ProportionManager.cs
  • src/Dock.Model/FactoryBase.Dockable.cs
  • src/Dock.Avalonia/Controls/PinnedDockControl.axaml.cs
  • src/Dock.Avalonia/Controls/DockableControl.cs
  • tests/Dock.Avalonia.UnitTests/Controls/ProportionalStackPanelTests.cs
  • tests/Dock.Avalonia.HeadlessTests/FactoryPinBoundsTests.cs
  • tests/Dock.Avalonia.HeadlessTests/DockableControlTrackingTests.cs
  • tests/Dock.Avalonia.HeadlessTests/PinnedDockControlTests.cs

Test run

  • dotnet test

@wieslawsoltes wieslawsoltes merged commit 598102c into master Jan 16, 2026
17 checks passed
@wieslawsoltes wieslawsoltes deleted the PinnedDockableSizingFixes branch January 16, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments