widget/geom.go

56 lines
894 B
Go
Raw Permalink Normal View History

package widget
type Geom struct {
Left any
Right any
Top any
Bottom any
}
type Size struct {
Width any
Height any
}
/*
Horizontal means layout widgets like books on a bookshelf
---------------------------------
| 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 |
---------------------------------
Vertical means layout widgets like books in a stack
----------
| Widget |
----------
| Widget |
----------
| Widget |
----------
| Widget |
----------
*/
type Orientation int
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"
}