layout.go 473 B

1234567891011121314151617181920212223242526272829303132
  1. package layout
  2. import (
  3. tea "github.com/charmbracelet/bubbletea/v2"
  4. )
  5. var Current *LayoutInfo
  6. func init() {
  7. Current = &LayoutInfo{
  8. Viewport: Dimensions{Width: 80, Height: 25},
  9. Container: Dimensions{Width: 80, Height: 25},
  10. }
  11. }
  12. type LayoutSize string
  13. type Dimensions struct {
  14. Width int
  15. Height int
  16. }
  17. type LayoutInfo struct {
  18. Viewport Dimensions
  19. Container Dimensions
  20. }
  21. type Modal interface {
  22. tea.Model
  23. Render(background string) string
  24. Close() tea.Cmd
  25. }