add function to update board mode
This commit is contained in:
parent
70238291e7
commit
04f76daae9
2 changed files with 9 additions and 5 deletions
|
@ -49,8 +49,7 @@ func (a *App) move() {
|
||||||
if a.mode == normal {
|
if a.mode == normal {
|
||||||
a.statusSelection.cardID = a.focusedCardID()
|
a.statusSelection.cardID = a.focusedCardID()
|
||||||
a.statusSelection.currentStatusID = a.focusedStatusID()
|
a.statusSelection.currentStatusID = a.focusedStatusID()
|
||||||
a.mode = selection
|
a.updateBoardMode(selection)
|
||||||
a.modeView.update(a.mode)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,14 +119,13 @@ func (a *App) selected() {
|
||||||
}
|
}
|
||||||
|
|
||||||
a.statusSelection = statusSelection{0, 0, 0}
|
a.statusSelection = statusSelection{0, 0, 0}
|
||||||
a.mode = normal
|
a.updateBoardMode(normal)
|
||||||
a.refresh(false)
|
a.refresh(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) escape() {
|
func (a *App) escape() {
|
||||||
if a.mode != normal {
|
if a.mode != normal {
|
||||||
a.mode = normal
|
a.updateBoardMode(normal)
|
||||||
a.modeView.update(a.mode)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,6 +270,12 @@ func (a *App) boardMode() boardMode {
|
||||||
return a.mode
|
return a.mode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// updateBoardMode updates the board mode.
|
||||||
|
func (a *App) updateBoardMode(mode boardMode) {
|
||||||
|
a.mode = mode
|
||||||
|
a.modeView.update(mode)
|
||||||
|
}
|
||||||
|
|
||||||
// focusedCardID returns the ID of the card in focus.
|
// focusedCardID returns the ID of the card in focus.
|
||||||
func (a *App) focusedCardID() int {
|
func (a *App) focusedCardID() int {
|
||||||
focusedCard := a.columns[a.focusedColumn].focusedCard
|
focusedCard := a.columns[a.focusedColumn].focusedCard
|
||||||
|
|
Loading…
Reference in a new issue