Skip to content

Fix ToolDock GripMode Inheritance on Split#997

Merged
wieslawsoltes merged 3 commits intomasterfrom
fix/issue-868-gripmode-inheritance
Jan 22, 2026
Merged

Fix ToolDock GripMode Inheritance on Split#997
wieslawsoltes merged 3 commits intomasterfrom
fix/issue-868-gripmode-inheritance

Conversation

@wieslawsoltes
Copy link
Owner

PR Summary: Fix ToolDock GripMode Inheritance on Split (Issue 868)

Summary

This change fixes an issue where a ToolDock configured with GripMode = GripMode.AutoHide did not consistently apply that setting to new tool docks created during split operations. When a tool is dragged to split a tool dock, the new dock now inherits GripMode (and related tool-dock settings) from the original tool dock, ensuring consistent chrome behavior.

Implementation Details

Propagate ToolDock Settings During Split

When DockService creates a new ToolDock in SplitToolDockable, the new dock now copies tool-dock settings from the most relevant source dock:

  1. Prefer copying from the target dock being split (so the new dock matches the dock the user interacted with).
  2. Fall back to the source dock (the original owner of the tool) when the target dock is not a ToolDock.

The following properties are copied:

  • IsExpanded
  • AutoHide
  • GripMode

This ensures that dock chrome visibility and grip behavior are consistent for newly created tool docks.

Test Coverage

A new unit test validates that splitting a tool from a ToolDock with GripMode.AutoHide results in a new ToolDock that also uses GripMode.AutoHide.

Usage Notes

No API changes are required. Existing code that sets ToolDock.GripMode will now behave consistently when users split tools:

var toolDock = new ToolDock
{
    GripMode = GripMode.AutoHide,
    VisibleDockables = factory.CreateList<IDockable>()
};

// When a tool from toolDock is split into a new dock,
// the new ToolDock will now inherit GripMode.AutoHide.

Tests

  • dotnet test

Fixes #868

Copy IsExpanded, AutoHide, and GripMode to new tool docks.
Cover split into a new tool dock.
@wieslawsoltes wieslawsoltes merged commit c38bc2a into master Jan 22, 2026
1 check passed
@wieslawsoltes wieslawsoltes deleted the fix/issue-868-gripmode-inheritance branch January 22, 2026 08:34
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.

Sub ToolDock Does Not Inherit GripMode Properly

1 participant