2024-01-11 16:41:37 -06:00
|
|
|
package widget
|
|
|
|
|
|
|
|
type Geom struct {
|
|
|
|
Left any
|
|
|
|
Right any
|
|
|
|
Top any
|
|
|
|
Bottom any
|
|
|
|
}
|
|
|
|
|
|
|
|
type Size struct {
|
|
|
|
Width any
|
|
|
|
Height any
|
|
|
|
}
|
|
|
|
|
2024-01-11 17:19:05 -06:00
|
|
|
/*
|
2024-02-05 12:21:47 -06:00
|
|
|
Horizontal means layout widgets like books on a bookshelf
|
2024-01-11 17:19:05 -06:00
|
|
|
|
|
|
|
---------------------------------
|
|
|
|
| W | W | W | W | W | W | W | W |
|
|
|
|
| i | i | i | i | i | i | i | i |
|
|
|
|
| d | d | d | d | d | d | d | d |
|
|
|
|
| g | g | g | g | g | g | g | g |
|
|
|
|
| e | e | e | e | e | e | e | e |
|
|
|
|
| t | t | t | t | t | t | t | t |
|
|
|
|
---------------------------------
|
|
|
|
|
2024-02-05 12:21:47 -06:00
|
|
|
Vertical means layout widgets like books in a stack
|
2024-01-11 17:19:05 -06:00
|
|
|
----------
|
|
|
|
| Widget |
|
|
|
|
----------
|
|
|
|
| Widget |
|
|
|
|
----------
|
|
|
|
| Widget |
|
|
|
|
----------
|
|
|
|
| Widget |
|
|
|
|
----------
|
|
|
|
*/
|
|
|
|
type Orientation int
|
2024-01-11 16:41:37 -06:00
|
|
|
|
|
|
|
const (
|
|
|
|
Horizontal Orientation = iota
|
|
|
|
Vertical
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s Orientation) String() string {
|
|
|
|
switch s {
|
|
|
|
case Horizontal:
|
|
|
|
return "Horizontal"
|
|
|
|
case Vertical:
|
|
|
|
return "Vertical"
|
|
|
|
default:
|
|
|
|
return "Horizontal"
|
|
|
|
}
|
|
|
|
return "Horizontal"
|
|
|
|
}
|