Archive/Unarchive
Several other improvements
This commit is contained in:
@@ -13,10 +13,10 @@ import (
|
||||
|
||||
// TaskScreen holds all that's going on
|
||||
type TaskScreen struct {
|
||||
viewPort *ViewPort
|
||||
message string
|
||||
messageTimeout time.Duration
|
||||
messageTime time.Time
|
||||
cursor int
|
||||
|
||||
inputModal *termboxUtil.InputModal
|
||||
confirmModal *termboxUtil.ConfirmModal
|
||||
@@ -31,7 +31,9 @@ const (
|
||||
|
||||
func (screen *TaskScreen) initialize(bundle Bundle) error {
|
||||
var err error
|
||||
screen.currentTaskId = bundle.getInt(TaskBundleTaskIdKey, -1)
|
||||
if bundle != nil {
|
||||
screen.currentTaskId = bundle.getInt(TaskBundleTaskIdKey, -1)
|
||||
}
|
||||
if screen.currentTaskId == -1 {
|
||||
return errors.New("Task Screen Initialization Failed")
|
||||
}
|
||||
@@ -92,12 +94,12 @@ func (screen *TaskScreen) drawFooter() {
|
||||
}
|
||||
|
||||
func (screen *TaskScreen) moveCursorDown() bool {
|
||||
screen.viewPort.cursor++
|
||||
screen.cursor++
|
||||
return true
|
||||
}
|
||||
|
||||
func (screen *TaskScreen) moveCursorUp() bool {
|
||||
screen.viewPort.cursor--
|
||||
screen.cursor--
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user