add titles

Signed-off-by: Hadi <hadi@example.com>
This commit is contained in:
Hadi
2026-05-29 10:51:10 +02:00
parent 437e8f883d
commit 1aa4b92bb3
2 changed files with 12 additions and 9 deletions
+11 -9
View File
@@ -6,25 +6,28 @@ import (
ilovetui "github.com/anotherhadi/ilovetui"
)
func (m Model) newView(content string) tea.View {
v := tea.NewView(content)
v.AltScreen = true
v.WindowTitle = "Spilltea: " + m.projectName
return v
}
func (m Model) View() tea.View {
if m.width == 0 {
v := tea.NewView("")
v.AltScreen = true
return v
return m.newView("")
}
normal := m.renderNormal()
if m.copyAs.IsOpen() {
v := tea.NewView(m.copyAs.View(normal))
v.AltScreen = true
v := m.newView(m.copyAs.View(normal))
v.MouseMode = tea.MouseModeCellMotion
return v
}
if m.copy.IsOpen() {
v := tea.NewView(m.copy.View(normal))
v.AltScreen = true
v := m.newView(m.copy.View(normal))
v.MouseMode = tea.MouseModeCellMotion
return v
}
@@ -34,8 +37,7 @@ func (m Model) View() tea.View {
rendered = m.notifications.View(normal)
}
v := tea.NewView(rendered)
v.AltScreen = true
v := m.newView(rendered)
v.MouseMode = tea.MouseModeCellMotion
return v
}
+1
View File
@@ -45,6 +45,7 @@ func (m Model) View() tea.View {
v := tea.NewView(content)
v.AltScreen = true
v.MouseMode = tea.MouseModeCellMotion
v.WindowTitle = "Spilltea"
return v
}