1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
package tui
import "github.com/grindlemire/go-tui/internal/layout"
type Display = layout.Display
const (
DisplayBlock = layout.DisplayBlock
DisplayFlex = layout.DisplayFlex
)
type Direction = layout.Direction
const (
Row = layout.Row
Column = layout.Column
)
type Justify = layout.Justify
const (
JustifyStart = layout.JustifyStart
JustifyEnd = layout.JustifyEnd
JustifyCenter = layout.JustifyCenter
JustifySpaceBetween = layout.JustifySpaceBetween
JustifySpaceAround = layout.JustifySpaceAround
JustifySpaceEvenly = layout.JustifySpaceEvenly
)
type Align = layout.Align
const (
AlignStart = layout.AlignStart
AlignEnd = layout.AlignEnd
AlignCenter = layout.AlignCenter
AlignStretch = layout.AlignStretch
)
type FlexWrap = layout.FlexWrap
const (
WrapNone = layout.WrapNone
Wrap = layout.Wrap
WrapReverse = layout.WrapReverse
)
type AlignContent = layout.AlignContent
const (
ContentStart = layout.ContentStart
ContentEnd = layout.ContentEnd
ContentCenter = layout.ContentCenter
ContentStretch = layout.ContentStretch
ContentSpaceBetween = layout.ContentSpaceBetween
ContentSpaceAround = layout.ContentSpaceAround
)
type Value = layout.Value
type LayoutStyle = layout.Style
type Rect = layout.Rect
type Edges = layout.Edges
type Size = layout.Size
type Point = layout.Point
type LayoutResult = layout.Layout
type Layoutable = layout.Layoutable
func Fixed(n int) Value {
return layout.Fixed(n)
}
func Percent(p float64) Value {
return layout.Percent(p)
}
func Auto() Value {
return layout.Auto()
}
func DefaultLayoutStyle() LayoutStyle {
return layout.DefaultStyle()
}
func NewRect(x, y, width, height int) Rect {
return layout.NewRect(x, y, width, height)
}
func EdgeAll(n int) Edges {
return layout.EdgeAll(n)
}
func EdgeSymmetric(v, h int) Edges {
return layout.EdgeSymmetric(v, h)
}
func EdgeTRBL(t, r, b, l int) Edges {
return layout.EdgeTRBL(t, r, b, l)
}
func Calculate(root Layoutable, availableWidth, availableHeight int) {
layout.Calculate(root, availableWidth, availableHeight)
}
func TableIntrinsicSize(table Layoutable) (width, height int) {
return layout.TableIntrinsicSize(table)
}
func InsetRect(r Rect, top, right, bottom, left int) Rect {
return r.Inset(layout.EdgeTRBL(top, right, bottom, left))
}
func InsetUniform(r Rect, n int) Rect {
return r.Inset(layout.EdgeAll(n))
}
|