~eliasnaur/gio

9469d18907629d56d3ed2cdb4ba7fe0f96b2ba0a — Inkeliz 11 months ago 01e8308
widget/material: fix hint when Editor is single-line

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
1 files changed, 5 insertions(+), 1 deletions(-)

M widget/material/editor.go
M widget/material/editor.go => widget/material/editor.go +5 -1
@@ 43,7 43,11 @@ func (e EditorStyle) Layout(gtx layout.Context) layout.Dimensions {
	defer op.Push(gtx.Ops).Pop()
	macro := op.Record(gtx.Ops)
	paint.ColorOp{Color: e.HintColor}.Add(gtx.Ops)
	tl := widget.Label{Alignment: e.Editor.Alignment}
	var maxlines int
	if e.Editor.SingleLine {
		maxlines = 1
	}
	tl := widget.Label{Alignment: e.Editor.Alignment, MaxLines: maxlines}
	dims := tl.Layout(gtx, e.shaper, e.Font, e.TextSize, e.Hint)
	call := macro.Stop()
	if w := dims.Size.X; gtx.Constraints.Min.X < w {