mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
all: rename layout.Dimens to layout.Dimensions
Dimens is only 4 characters shorter and not worth the abbreviation. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+3
-3
@@ -48,7 +48,7 @@ type Editor struct {
|
||||
viewSize image.Point
|
||||
valid bool
|
||||
lines []Line
|
||||
dims layout.Dimens
|
||||
dims layout.Dimensions
|
||||
padTop, padBottom int
|
||||
padLeft, padRight int
|
||||
requestFocus bool
|
||||
@@ -165,7 +165,7 @@ func (e *Editor) Focus() {
|
||||
e.requestFocus = true
|
||||
}
|
||||
|
||||
func (e *Editor) Layout(cfg ui.Config, queue input.Queue, ops *ui.Ops, cs layout.Constraints) layout.Dimens {
|
||||
func (e *Editor) Layout(cfg ui.Config, queue input.Queue, ops *ui.Ops, cs layout.Constraints) layout.Dimensions {
|
||||
for _, ok := e.Next(cfg, queue); ok; _, ok = e.Next(cfg, queue) {
|
||||
}
|
||||
twoDp := cfg.Px(ui.Dp(2))
|
||||
@@ -270,7 +270,7 @@ func (e *Editor) Layout(cfg ui.Config, queue input.Queue, ops *ui.Ops, cs layout
|
||||
pointer.RectAreaOp{Rect: r}.Add(ops)
|
||||
e.scroller.Add(ops)
|
||||
e.clicker.Add(ops)
|
||||
return layout.Dimens{Size: e.viewSize, Baseline: baseline}
|
||||
return layout.Dimensions{Size: e.viewSize, Baseline: baseline}
|
||||
}
|
||||
|
||||
// Text returns the contents of the editor.
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ func (l *lineIterator) Next() (String, f32.Point, bool) {
|
||||
return String{}, f32.Point{}, false
|
||||
}
|
||||
|
||||
func (l Label) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimens {
|
||||
func (l Label) Layout(ops *ui.Ops, cs layout.Constraints) layout.Dimensions {
|
||||
textLayout := l.Face.Layout(l.Text, LayoutOptions{MaxWidth: cs.Width.Max})
|
||||
lines := textLayout.Lines
|
||||
if max := l.MaxLines; max > 0 && len(lines) > max {
|
||||
|
||||
+2
-2
@@ -61,7 +61,7 @@ const (
|
||||
Middle
|
||||
)
|
||||
|
||||
func linesDimens(lines []Line) layout.Dimens {
|
||||
func linesDimens(lines []Line) layout.Dimensions {
|
||||
var width fixed.Int26_6
|
||||
var h int
|
||||
var baseline int
|
||||
@@ -78,7 +78,7 @@ func linesDimens(lines []Line) layout.Dimens {
|
||||
h += lines[len(lines)-1].Descent.Ceil()
|
||||
}
|
||||
w := width.Ceil()
|
||||
return layout.Dimens{
|
||||
return layout.Dimensions{
|
||||
Size: image.Point{
|
||||
X: w,
|
||||
Y: h,
|
||||
|
||||
Reference in New Issue
Block a user