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

Properly align Label in a FormItem #1531

Closed
AlbinoGeek opened this issue Nov 14, 2020 · 3 comments
Closed

Properly align Label in a FormItem #1531

AlbinoGeek opened this issue Nov 14, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@AlbinoGeek
Copy link
Contributor

Is your feature request related to a problem? Please describe:

When you have a Label and an Entry in a FormItem, the Label is missing top-padding required to bring its text in line with the Entry's text.

Example:

image

	updatePeriod := widget.NewEntry()
	updatePeriod.SetText(getUpdateDuration().String())
	// ...
	window.SetContent(widget.NewVBox(
		widget.NewGroup("Updates",
			widget.NewForm(
				widget.NewFormItem("Time Between Checks", updatePeriod),
			),
		),
	))
	// ...

Is it possible to construct a solution with the existing API?

Yes.

Describe the solution you'd like to see:

Add 3-5 pixels of top padding to Label inside a FormItem

The baseline of the two pieces of text should match horizontally.

@andydotxyz andydotxyz added the bug Something isn't working label Nov 15, 2020
@AlbinoGeek AlbinoGeek changed the title [FEATURE REQUEST] Properly align Label in a FormItem Properly align Label in a FormItem Nov 17, 2020
@stuartmscott
Copy link
Member

This may not be specific to widget.Form, instead we may want canvas.Text to be drawn in the vertical center of the texture (currently d.Dot = freetype.Pt(0, height-face.Metrics().Descent.Ceil()))

@AlbinoGeek
Copy link
Contributor Author

I think that may even fix the issue with Button and Label alignment if that were the case.

@andydotxyz
Copy link
Member

On develop for testing :)

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

No branches or pull requests

3 participants