-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SizeName property to label to control text size #5570
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this really needs some tests, make sure the label is scaling appropriately, updates on change and that the selection follows it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding a test.
I'm surprised that the images are the same size - does this indicate that the MinSize function is not updating, or that the test isn't respecting it?
I assume that a label with larger or smaller text would have a MinSize adjustment accordingly?
The label's min size is larger, the test window just wasn't respecting it - pushed an update to the test to just use w.SetContent again to make sure the window expands to respect the new min size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet thanks
tyvm for implementing this feature! sorry for my late comment (literally just saw this). But wouldn't it be better to limit the user to text-related sizes? e.g. by defaulting to normal size when a non-text related size is specified? |
you mean preventing something like |
ty for the clarification. did not realize that the RichText and Hyperlink API also allows it and in that regards it makes indeed more sense to keep it the same. |
Description:
Allows for controlling the text size of a Label widget. Especially useful with selection support landing in 2.6 as the only other way to customize the size of selectable text would be a ThemeOverride container, which is heavyweight and verbose.
This mirrors the API that already exists for Hyperlink sizing.
Fixes #5561
Checklist:
Where applicable: