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

width of multiline text lable wrong on windows 10 #464

Open
maggch97 opened this issue May 8, 2019 · 0 comments · May be fixed by #465
Open

width of multiline text lable wrong on windows 10 #464

maggch97 opened this issue May 8, 2019 · 0 comments · May be fixed by #465
Milestone

Comments

@maggch97
Copy link

maggch97 commented May 8, 2019

On windows 10 1903, the width of multiline text lable is the sum of each line's width

below is my Go test code

package main

import (
	"github.com/andlabs/ui"
	_ "github.com/andlabs/ui/winmanifest"
)
func setupUi() {
	mainwin := ui.NewWindow("", 100, 500, true)
	hbox := ui.NewHorizontalBox()
	mainwin.SetChild(hbox)
	b := ui.NewButton("TEST")
	l := ui.NewLabel("")
	hbox.Append(b, true)
	hbox.Append(l, true)
	s1 := "\r\n\r\n1\r\n\r\n\r\n\r\n"
	s2 := "1"
	for i := 0; i < 6; i++ {
		s1 += s1
		s2 += s2
	}
	b.OnClicked(func(button *ui.Button) {
		if l.Text() == s1{
			l.SetText(s2)
		}else{
			l.SetText(s1)
		}
	})
	mainwin.Show()
}
func main() {
	ui.Main(setupUi)
}

image
image
image

@maggch97 maggch97 linked a pull request May 8, 2019 that will close this issue
@andlabs andlabs added this to the Alpha 5 milestone May 8, 2019
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

Successfully merging a pull request may close this issue.

2 participants