fix(controls): Fixed issues with InfoBar #1623
Merged
+45
−2
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.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
When InfoBar's
IsOpenproperty is set tofalse, the internal element “InfoBarRoot” is collapsed, but the InfoBar control itself remains visible in layout. This causes the margin and padding of InfoBar to still occupy space.Example usage:
Example:
InfoBar-close-RootGrid.mp4
When the Title is empty, the space occupied by its TextBlock is not released, causing the TextBox displaying the Message to be squeezed out.
Currently, the InfoBar lacks appropriate border colors for different severity levels, and there are no suitable resource keys available even when customizing its style.
What is the new behavior?
InfoBar will be truly “closed” and will not occupy any layout space.
Example:
InfoBar-close-Self.mp4
When the Title is empty, the Message aligns to the position where the Title would be.
Four new brush keys have been added to the existing themes:
InfoBarErrorSeverityBorderBrush,InfoBarWarningSeverityBorderBrush,InfoBarSuccessSeverityBorderBrush, andInfoBarInformationalSeverityBorderBrush. These allow developers to easily override and customize the styles. Please note that, to maintain consistency with WinUI InfoBar behavior, the corresponding color values remain unchanged.Other information