mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
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:
+13
-4
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user