ui/text: rename Center Alignment to Middle and drop IsNewline

Middle matches the similar layout.Middle constant, and IsNewline is
too simple to export.

Add documentation while we're here.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-08-11 19:25:50 +02:00
parent 628a97cd71
commit 2f9ac5aebb
4 changed files with 44 additions and 16 deletions
+13 -4
View File
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: Unlicense OR MIT
// Package text implements text widgets.
package text
import (
@@ -15,12 +16,20 @@ import (
"golang.org/x/image/math/fixed"
)
// Label is a widget for laying out and drawing text.
type Label struct {
Face Face
Material ui.MacroOp
// Face define the font and style of the text.
Face Face
// Material is a macro recording the material to draw the
// text. Use a ColorOp for colored text.
Material ui.MacroOp
// Alignment specify the text alignment.
Alignment Alignment
Text string
MaxLines int
// Text is the string to draw.
Text string
// MaxLines specify the maximum number of lines the text
// may fill.
MaxLines int
it lineIterator
}