Some refactoring and fixing in confirmation popup implementation

- Restoring focus to previous (taskPane) panel after closing modal (works only when invoked with shortcut)
- `projectPane.RemoveActivateProject()` and `taskPane.ClearCompletedTasks()` do comply with `func()`. So no need to wrap within `func() {}`
- Fixed issue - Project dosen't exit with Ctrl+C once (maybe because of re-running `.Run()` in `AskYesNo()`).
- When focusing back to tasklist from task detail, re-showing projectDetail pane
This commit is contained in:
Anis Ahmad
2022-01-07 21:33:59 +06:00
parent e466e2f801
commit ca0479b28a
3 changed files with 19 additions and 13 deletions

View File

@@ -289,8 +289,9 @@ func writeToTmpFile(content string) (string, error) {
func (td *TaskDetailPane) handleShortcuts(event *tcell.EventKey) *tcell.EventKey {
switch event.Key() {
case tcell.KeyEsc:
removeThirdCol()
app.SetFocus(taskPane)
contents.RemoveItem(taskDetailPane)
contents.AddItem(projectDetailPane, 25, 0, false)
return nil
case tcell.KeyDown:
td.taskDetailView.ScrollDown(1)