-
-
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
RichTextSegment SizeName is not SizeNameText by default #5307
Comments
What should be expected output?
|
I'm not sure what we can do, your code is creating a new TextSegment with a blank SizeNameText... |
That is a good point... I guess I was thinking that in |
I think it could make sense for the builtin theme to return the size corresponding to |
That's assuming that an empty size name is always referring to text, which seems dangerous.
Yes it would, but at a significant possible impact to other areas. Thinking about it would it not make more sense to put the workaround in the measure text, where it defaults to something sane if it's 0.0? |
If there's never a reason to measure text with a size of 0 this mostly makes sense to me, but maybe that's useful to someone somewhere? If none of these feel like good solutions I'd be inclined to suggest that there's maybe nothing to change here and people doing this will figure it out like I did. Like part of me thinks that measure text shouldn't "guess" what you mean and should just return 0 if you pass it 0, do what it says it's doing. I opened this because it was a rare "that didn't just work" moment in Fyne for me, but upon inspection I could see no change being warranted here. |
That's an interesting point - is there ever a reason to measure 0 size text? It feels quite meaningless to me, and a |
I kind of agree with this. Especially since this is the direction we have gone in other areas (e.g. rejecting the idea that passing a duration of 0 to |
I agree with this, calling out that an empty |
Checklist
Describe the bug
When one creates a new
widget.RichText
, the value ofwidget.RichTextStyle.SizeName
for the segments is nottheme.SizeNameText
by default, it's empty. I think it should default totheme.SizeNameText
. At least, I would expectfyne.MeasureText
to work out of the box without setting the size name, and it doesn't.How to reproduce
Produces:
Screenshots
No response
Example code
see "how to reproduce"
Fyne version
2.5.0
Go compiler version
go1.23.2 linux/amd64
Operating system and version
Arch Linux
Additional Information
No response
The text was updated successfully, but these errors were encountered: