chore: rework layout primitives

This commit is contained in:
adamdottv
2025-06-28 06:04:01 -05:00
parent d090c08ef0
commit 9f3ba03965
7 changed files with 298 additions and 589 deletions

View File

@@ -22,7 +22,7 @@ import (
type EditorComponent interface {
tea.Model
tea.ViewModel
layout.Sizeable
SetSize(width, height int) tea.Cmd
Content() string
Lines() int
Value() string
@@ -158,7 +158,15 @@ func (m *editorComponent) Content() string {
func (m *editorComponent) View() string {
if m.Lines() > 1 {
return ""
t := theme.CurrentTheme()
return lipgloss.Place(
m.width,
m.height,
lipgloss.Center,
lipgloss.Center,
"",
styles.WhitespaceStyle(t.Background()),
)
}
return m.Content()
}