[WIP] Task editing
This commit is contained in:
@ -141,6 +141,9 @@ func (p *ReportPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
p.subpageActive = true
|
||||
p.common.PushPage(p)
|
||||
return p.subpage, nil
|
||||
case key.Matches(msg, p.common.Keymap.Ok):
|
||||
p.common.TW.SetTaskDone(p.selectedTask)
|
||||
return p, p.getTasks()
|
||||
case key.Matches(msg, p.common.Keymap.SetProject):
|
||||
p.subpage = NewProjectPickerPage(p.common, p.activeProject)
|
||||
p.subpage.Init()
|
||||
|
||||
@ -43,7 +43,12 @@ func NewTaskEditorPage(common *common.Common, task taskwarrior.Task) *TaskEditor
|
||||
p := &TaskEditorPage{
|
||||
common: common,
|
||||
task: task,
|
||||
mode: ModeInsert,
|
||||
}
|
||||
|
||||
if p.task.Uuid == "" {
|
||||
p.mode = ModeInsert
|
||||
} else {
|
||||
p.mode = ModeNormal
|
||||
}
|
||||
|
||||
if p.task.Priority == "" {
|
||||
@ -197,7 +202,7 @@ func (p *TaskEditorPage) View() string {
|
||||
return lipgloss.JoinVertical(
|
||||
lipgloss.Left,
|
||||
// lipgloss.Place(p.common.Width(), p.common.Height()-1, 0.5, 0.5, p.form.View(), lipgloss.WithWhitespaceBackground(p.common.Styles.Warning.GetForeground())),
|
||||
lipgloss.Place(p.common.Width(), p.common.Height()-1, 0.5, 0.5, p.form.View(), lipgloss.WithWhitespaceChars(".")),
|
||||
lipgloss.Place(p.common.Width(), p.common.Height()-1, 0.5, 0.5, p.form.View(), lipgloss.WithWhitespaceChars(" . ")),
|
||||
p.statusline.View(),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user