Fix DrawerPage double footer on compact mode for Bottom/Top placement by jsuarezruiz · Pull Request #21004 · AvaloniaUI/Avalonia (original) (raw)
What does the pull request do?
This PR fixes an issue in DrawerPage when using compact modes together with horizontal drawer placements.
The issue caused a duplicated footer when DrawerPlacement=Bottom was combined with DisplayMode=CompactOverlay or CompactInline.
This PR updates both Fluent and Simple themes to correctly handle these placement and display mode combinations, and also adds render tests to cover all the scenarios.
What is the current behavior?
When DrawerPlacement=Bottom is used together with CompactOverlay or CompactInline, both PART_BottomBar and PART_CompactPaneToggle are visible at the bottom at the same time, producing a double footer.
What is the updated/expected behavior with this PR?
With this PR:
PART_BottomBaris hidden whenDrawerPlacement=Bottomis combined withCompactOverlayorCompactInline, avoiding the duplicated footer.PART_CompactPaneToggleis docked to the left forBottomandTopplacement, so the compact toggle occupies only the left part of the horizontal strip and the drawer content can use the remaining space.- Reviewed and added tests to ensure that Compact drawer behavior is now consistent across left, right, bottom, and top placements.
How to test:
- Run a
DrawerPagewithDrawerPlacement=BottomandDisplayMode=CompactOverlay. Verify that only one bottom toggle area is shown. - Run a
DrawerPagewithDrawerPlacement=BottomandDisplayMode=CompactInline. Verify that only one bottom toggle area is shown. - Run a
DrawerPagewithDrawerPlacement=BottomorTopin compact mode. Verify that the compact toggle is placed on the left side of the horizontal strip and that the drawer content is laid out beside it instead of overlapping. - Run the render tests and verify the expected output for the added placement and mode combinations.
How was the solution implemented (if it's not obvious)?
For the double footer issue, styles were added to both Fluent and Simple themes to hide PART_BottomBar when DrawerPlacement=Bottom is combined with either CompactOverlay or CompactInline. In these cases, PART_CompactPaneToggle already provides the required toggle affordance, so showing PART_BottomBar as well is redundant.
This PR also adds 6 render tests covering the previously missing placement and mode combinations, including:
- Right + CompactOverlay closed
- Right + CompactInline closed
- Bottom + CompactOverlay closed
- Bottom + CompactInline closed
- Top + CompactOverlay closed
- Top + CompactInline closed
These tests complete the compact placement coverage matrix.
Checklist
- Added unit tests (if possible)?
- Added XML documentation to any related classes?
- Consider submitting a PR to https://github.com/AvaloniaUI/avalonia-docs with user documentation
Breaking changes
None.
Obsoletions / Deprecations
None.
Fixed issues
Fix #20997