opencode_offline/packages/tui/internal/layout/layout.go

33 lines
473 B
Go
Raw Normal View History

2025-03-22 01:20:28 +08:00
package layout
import (
2025-06-12 18:35:40 +08:00
tea "github.com/charmbracelet/bubbletea/v2"
2025-03-22 01:20:28 +08:00
)
2025-06-06 04:44:20 +08:00
var Current *LayoutInfo
func init() {
Current = &LayoutInfo{
Viewport: Dimensions{Width: 80, Height: 25},
Container: Dimensions{Width: 80, Height: 25},
}
}
type LayoutSize string
type Dimensions struct {
Width int
Height int
}
type LayoutInfo struct {
Viewport Dimensions
Container Dimensions
}
2025-06-13 05:00:20 +08:00
type Modal interface {
tea.Model
Render(background string) string
Close() tea.Cmd
}