Skip to content

width of multiline text lable wrong on windows 10 #464

@maggch97

Description

@maggch97

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions