A free and open source framework for building powerful, fast, elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the web with a single Go codebase, allowing you to Code Once, Run Everywhere.
When styling a text field you can set the font size very intuitively with a styler with either s.Font.Size.Pt(12) or s.Font.Size = units.Pt(12) however this does not change the size of the trailing icon where present (for example those added by AddClearButton() or SetTypePassword())
Instead it appears that one must nest calls to tree.AddChildInit two deep to get to the actual icon (see example code)
In addition one must hunt for the appropriate child name of "trail-icon" which is a *core.Button and not a *core.Icon (somewhat contrary to the conclusion that widget part names are not rocket science reached in https://github.com/cogentcore/core/issues/840)
If there's a better way to do this that I've just overlooked in my search please do let me know.
How to reproduce
Create a new text field widget
Set the font size and observe icons that are included in the field do not follow the size change
Thank you for raising this. The API has changed since #840, and we will reconsider the best approach to this issue, in addition to improving the documentation.
Describe the bug
When styling a text field you can set the font size very intuitively with a styler with either
s.Font.Size.Pt(12)
ors.Font.Size = units.Pt(12)
however this does not change the size of the trailing icon where present (for example those added byAddClearButton()
orSetTypePassword()
)Instead it appears that one must nest calls to
tree.AddChildInit
two deep to get to the actual icon (see example code) In addition one must hunt for the appropriate child name of "trail-icon" which is a*core.Button
and not a*core.Icon
(somewhat contrary to the conclusion that widget part names are not rocket science reached in https://github.com/cogentcore/core/issues/840)If there's a better way to do this that I've just overlooked in my search please do let me know.
How to reproduce
Create a new text field widget Set the font size and observe icons that are included in the field do not follow the size change
Example code
Relevant output
No response
Platform
Linux