Skip to content

Conversation

@nicolaihenriksen
Copy link
Contributor

Fixes #2686

Refactors the SmartHint such that it is allowed to take up the available width of the "container" when the hint is floated. Previously, when the hint was floated, it was the FloatingHintTextBlock which was both moved and scaled down which effectively meant that the "available space" was scaled down with it.

This PR changes that "animation" such that the scaling is still applied to the FloatingHintTextBlock but the moving of it is done on a Canvas which is not scaled down, but simply moved. This allows it to retain its full (available) width.

Before the changes, the floating hints that exceeded the available width looked like this when floated (animations slowed down for better overview):

FieldHintBefore
ComboBoxHintBefore

In both of these cases, the hint text is actually longer than what is displayed, but even when space becomes available it does not show.

After the changes, they now look like this:

FieldHintAfter
ComboBoxHintAfter

As can be seen, the text is actually still too long to be fully displayed, but at least it now uses more of the available space. It could be considered to add TextTrimming="CharacterEllipsis" and perhaps even a ToolTip (when truncated) if that is desirable.

Places the FloatingHintTextBox inside of a Canvas and splits the RenderTransform in 2 by applying the TranslateTransform to the Canvas (to move it) and the ScaleTransform to the FloatingHintTextBlock (to scale it down)
@Keboo Keboo added this to the 4.7.1 milestone Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Floating hint of TextBox is cut off

2 participants