Skip to content

Fix DatePicker and TimePicker separator alignment with VerticalContentAlignment - #22023

Merged
MrJul merged 3 commits into
AvaloniaUI:mainfrom
zrt2399:fix_issue_22022
Aug 24, 2026
Merged

Fix DatePicker and TimePicker separator alignment with VerticalContentAlignment#22023
MrJul merged 3 commits into
AvaloniaUI:mainfrom
zrt2399:fix_issue_22022

Conversation

@zrt2399

@zrt2399 zrt2399 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

What does the pull request do?

Fixes #22022

What is the current behavior?

image image

What is the updated/expected behavior with this PR?

d63613bb3c2429c0f266dd7217ae1fa2 7df9035e4fbde128d67158ad2787a472

Fixed issues

Fixes #22022

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068553-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068559-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul added bug backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Aug 20, 2026
@jsuarezruiz

Copy link
Copy Markdown
Member

@MrJul #21464 and this PR both carry backport-candidate-12.1.x. They need to go together, backporting #21464 alone would ship 12.1 with the broken separators.

@jsuarezruiz jsuarezruiz self-assigned this Aug 24, 2026

@jsuarezruiz jsuarezruiz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests #21464 added assert that the CLR property round-trips but not apply a theme or inspect the visual tree, so they'd pass even if the template binding did nothing.

A render test would catch wrong scenarios. For example, tests/Avalonia.RenderTests/Controls/CommandBarTests.cs applies the Simple theme and compares baseline PNGs.

VerticalAlignment="Stretch"
TemplatedControl.IsTemplateFocusTarget="True">
<Grid Name="PART_ButtonContentGrid" ColumnDefinitions="78*,Auto,132*,Auto,78*" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid Name="PART_ButtonContentGrid" ColumnDefinitions="78*,Auto,132*,Auto,78*">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix seems correct, the alignment belonged on the text, not on the container, since PART_ButtonContentGrid also holds the separator Rectangles. Removing vertical alignment restores the pre-#21464 separator behavior while keeping the new property working.

@MrJul
MrJul enabled auto-merge August 24, 2026 13:21
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0068673-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
MrJul added this pull request to the merge queue Aug 24, 2026
Merged via the queue into AvaloniaUI:main with commit f1e09e4 Aug 24, 2026
10 checks passed
MrJul pushed a commit to MrJul/Avalonia that referenced this pull request Sep 2, 2026
…tAlignment (AvaloniaUI#22023)

* Fix DatePicker and TimePicker separator alignment with VerticalContentAlignment

* Fix DatePicker and TimePicker separator alignment in Simple Theme

---------

Co-authored-by: Javier Suárez <javiersuarezruiz@hotmail.com>
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DatePicker and TimePicker separator alignment is affected by VerticalContentAlignment

4 participants