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

Autosized buttons #505

Open
dodopod opened this issue Jan 13, 2023 · 1 comment
Open

Autosized buttons #505

dodopod opened this issue Jan 13, 2023 · 1 comment

Comments

@dodopod
Copy link

dodopod commented Jan 13, 2023

Is there any way to make a button that sizes itself to its text? This seems like it should be really simple, but I can't seem to figure it out. As far as I can tell, the examples all just manually set the size of the button. The best I've been able to figure out is something like this, which is really inelegant:

- Button:
  width == systemFont().sizeOfString("hello").width + 10
  height == systemFont().sizeOfString("hello").height + 10

  title: "hello"
@yglukhov
Copy link
Owner

Currently there is no automatic sizing based on text size, though that's definitely something that should be done eventually.

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

No branches or pull requests

2 participants