Configurable Mouse-Wheel Scroll Direction for Tool and Document Tab Strips#1027
Merged
wieslawsoltes merged 4 commits intomasterfrom Feb 7, 2026
Merged
Conversation
This was referenced Feb 11, 2026
Closed
This was referenced Feb 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary: Configurable Mouse-Wheel Scroll Direction for Tool and Document Tab Strips
Branch
feature/tabstrip-wheel-scroll-orientationProblem Statement
When tab overflow occurs in
ToolTabStripandDocumentTabStrip, mouse-wheel behavior was not configurable for tab overflow navigation. The requested behavior is:Goals
MouseWheelScrollOrientation.Final Design
The final implementation uses template-time
PART_ScrollViewerevent wiring in control code-behind:PART_ScrollViewerinOnApplyTemplate.ScrollViewerline-scroll API based on the configured orientation.MouseWheelScrollOrientationproperty changes, controls reattach the handler so behavior updates immediately.This replaces the intermediate approach that handled wheel at the tab strip level or via attached behavior bindings.
Detailed Changes
1. Shared scrolling logic helper
File:
/Users/wieslawsoltes/GitHub/Dock/src/Dock.Avalonia/Internal/TabStripMouseWheelScrollHelper.csProvides:
TryHandle(ScrollViewer? scrollViewer, Orientation orientation, Vector delta)Behavior:
falsefor null viewer, no wheel delta, or no overflow in target axis.delta.Yand converts magnitude to line-step count.LineLeft/LineRightorLineUp/LineDown.trueonly if offset changed.2. New hook helper for
PART_ScrollViewerFile:
/Users/wieslawsoltes/GitHub/Dock/src/Dock.Avalonia/Internal/ScrollViewerMouseWheelHookHelper.csProvides:
Attach(ScrollViewer? scrollViewer, Orientation orientation) : IDisposable?Behavior:
scrollViewer.PointerWheelChanged.TabStripMouseWheelScrollHelper.TryHandle(...).e.Handledonly on actual scroll movement.3.
DocumentTabStripupdatesFile:
/Users/wieslawsoltes/GitHub/Dock/src/Dock.Avalonia/Controls/DocumentTabStrip.axaml.csKey updates:
MouseWheelScrollOrientation(defaultHorizontal)PART_ScrollViewerinOnApplyTemplateand hooks wheel handling through helper.MouseWheelScrollOrientationchanges.OnAttachedToVisualTree.OnDetachedFromVisualTree.4.
ToolTabStripupdatesFile:
/Users/wieslawsoltes/GitHub/Dock/src/Dock.Avalonia/Controls/ToolTabStrip.axaml.csKey updates:
MouseWheelScrollOrientation(defaultHorizontal)PART_ScrollViewerinOnApplyTemplateand hooks wheel handling through helper.MouseWheelScrollOrientationchanges.OnDetachedFromVisualTree.OnAttachedToVisualTree.5. Tests
File:
/Users/wieslawsoltes/GitHub/Dock/tests/Dock.Avalonia.HeadlessTests/TabStripMouseWheelScrollTests.csCoverage now includes:
DocumentTabStrip_MouseWheelScrollsHorizontally_ByDefaultToolTabStrip_MouseWheelScrollsHorizontally_ByDefaultDocumentTabStrip_CanScrollVertically_WhenConfiguredDocumentTabStrip_MouseWheelScrollOrientation_ChangesAtRuntimeToolTabStrip_MouseWheelScrollOrientation_ChangesAtRuntimeDocumentTabStrip_MouseWheelScrolls_AfterDetachAndReattachToolTabStrip_MouseWheelScrolls_AfterDetachAndReattachNotes:
ScrollViewer-level hooks.6. Existing API docs and defaults
Previously added docs/default assertions remain valid:
/Users/wieslawsoltes/GitHub/Dock/docfx/articles/dock-controls-reference.md/Users/wieslawsoltes/GitHub/Dock/tests/Dock.Avalonia.Diagnostics.UnitTests/DockControlInstantiationTests.csPublic API Impact
New Properties (already introduced in this branch)
DocumentTabStrip.MouseWheelScrollOrientation : Orientation(defaultHorizontal)ToolTabStrip.MouseWheelScrollOrientation : Orientation(defaultHorizontal)Breaking Changes
Behavior Matrix
Validation Performed
dotnet test tests/Dock.Avalonia.HeadlessTests/Dock.Avalonia.HeadlessTests.csproj --filter "FullyQualifiedName~TabStripMouseWheelScrollTests"dotnet test tests/Dock.Avalonia.Diagnostics.UnitTests/Dock.Avalonia.Diagnostics.UnitTests.csproj --filter "FullyQualifiedName~DockControlInstantiationTests"dotnet build src/Dock.Avalonia/Dock.Avalonia.csproj -f net10.0Usage Example
Risk Assessment
Low risk:
Rollback Plan
If issues arise:
MouseWheelScrollOrientationcommits in this branch.Reviewer Checklist
PART_ScrollViewerand not tab strip override.