fix(ui): add card title in deletion prompt
This commit updates the delete card modal so that the prompt includes the title of the card that is about to be deleted. This is to give the user the confidence that they are deleting the intended card. The modal has also been updated to match the current theme of the application. Resolves apollo/pelican#18
This commit is contained in:
parent
3703a7fd88
commit
ee861e5426
1 changed files with 9 additions and 3 deletions
|
@ -147,6 +147,9 @@ func (u *UI) inputCapture() func(event *tcell.EventKey) *tcell.EventKey {
|
|||
}
|
||||
case key == tcell.KeyCtrlD:
|
||||
if u.mode == normal {
|
||||
card, _ := u.getFocusedCard()
|
||||
text := fmt.Sprintf("Do you want to delete '%s'?", card.Title)
|
||||
u.deleteCardModal.SetText(text)
|
||||
u.pages.ShowPage(deleteCardModalPage)
|
||||
u.SetFocus(u.deleteCardModal)
|
||||
}
|
||||
|
@ -214,9 +217,12 @@ func (u *UI) initDeleteCardModal() {
|
|||
u.setColumnFocus()
|
||||
}
|
||||
|
||||
u.deleteCardModal.SetText("Do you want to delete this card?").
|
||||
AddButtons([]string{"Confirm", "Cancel"}).
|
||||
SetDoneFunc(doneFunc)
|
||||
u.deleteCardModal.AddButtons([]string{"Confirm", "Cancel"}).SetDoneFunc(doneFunc)
|
||||
|
||||
u.deleteCardModal.SetBorder(true).SetBorderColor(tcell.ColorOrangeRed)
|
||||
u.deleteCardModal.SetBackgroundColor(tcell.ColorBlack.TrueColor())
|
||||
u.deleteCardModal.SetButtonBackgroundColor(tcell.ColorBlueViolet.TrueColor())
|
||||
u.deleteCardModal.SetTextColor(tcell.ColorWhite.TrueColor())
|
||||
}
|
||||
|
||||
// initQuitModal initialises the quit modal.
|
||||
|
|
Loading…
Reference in a new issue