Skip to content
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

Button style font size did not have effect. how to set default font size for all. #1150

Closed
runsys opened this issue Aug 18, 2024 · 1 comment
Labels
bug Something isn't working correctly

Comments

@runsys
Copy link

runsys commented Aug 18, 2024

Describe the bug

Button style font size did not have effect. how to set default font size by code for all.
version about 20240706
os freebsd 14.1

How to reproduce

see code in picture
屏幕截图 2024-08-19 075046

Example code

No response

Relevant output

No response

Platform

macOS

@runsys runsys added the bug Something isn't working correctly label Aug 18, 2024
@kkoreilly
Copy link
Member

You can use this code to set the font size of the button text:

	bt := core.NewButton(b).SetText("Hello")
	tree.AddChildInit(bt, "text", func(w *core.Text) {
		w.Styler(func(s *styles.Style) {
			s.Font.Size.Dp(48)
			s.Text.LineHeight.Dp(48)
		})
	})

If you want to change the font size of all elements, you can change the Font size in the Settings menu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

2 participants