WIP
This commit is contained in:
@@ -3,8 +3,8 @@ package pages
|
||||
import (
|
||||
"tasksquire/internal/common"
|
||||
|
||||
tea "charm.land/bubbletea/v2"
|
||||
"charm.land/bubbles/v2/key"
|
||||
tea "charm.land/bubbletea/v2"
|
||||
"charm.land/lipgloss/v2"
|
||||
)
|
||||
|
||||
@@ -48,7 +48,7 @@ func (m *MainPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
m.common.SetSize(msg.Width, msg.Height)
|
||||
|
||||
tabHeight := lipgloss.Height(m.renderTabBar())
|
||||
contentHeight := max(msg.Height - tabHeight, 0)
|
||||
contentHeight := max(msg.Height-tabHeight, 0)
|
||||
|
||||
newMsg := tea.WindowSizeMsg{Width: msg.Width, Height: contentHeight}
|
||||
activePage, cmd := m.activePage.Update(newMsg)
|
||||
@@ -58,14 +58,14 @@ func (m *MainPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
case tea.KeyMsg:
|
||||
// Only handle tab key for page switching when at the top level (no subpages active)
|
||||
if key.Matches(msg, m.common.Keymap.Next) && !m.common.HasSubpages() {
|
||||
// if m.activePage == m.taskPage {
|
||||
// m.activePage = m.timePage
|
||||
// m.currentTab = 1
|
||||
// } else {
|
||||
// m.activePage = m.taskPage
|
||||
// m.currentTab = 0
|
||||
// }
|
||||
//
|
||||
// if m.activePage == m.taskPage {
|
||||
// m.activePage = m.timePage
|
||||
// m.currentTab = 1
|
||||
// } else {
|
||||
// m.activePage = m.taskPage
|
||||
// m.currentTab = 0
|
||||
// }
|
||||
//
|
||||
tabHeight := lipgloss.Height(m.renderTabBar())
|
||||
contentHeight := m.height - tabHeight
|
||||
if contentHeight < 0 {
|
||||
@@ -100,7 +100,7 @@ func (m *MainPage) renderTabBar() string {
|
||||
}
|
||||
|
||||
func (m *MainPage) View() tea.View {
|
||||
v := tea.NewView(lipgloss.JoinVertical(lipgloss.Left, m.renderTabBar(), m.activePage.View().Content))
|
||||
v := tea.NewView(lipgloss.NewStyle().Margin(1, 3).Render(lipgloss.JoinVertical(lipgloss.Left, m.renderTabBar(), m.activePage.View().Content)))
|
||||
v.AltScreen = true
|
||||
return v
|
||||
// return lipgloss.JoinVertical(lipgloss.Left, m.renderTabBar(), m.activePage.View())
|
||||
|
||||
Reference in New Issue
Block a user