Add escape as a keybinding to exit screens without saving

feature/make_board_screen
Alex Selimov 1 year ago
parent c7e180459b
commit 34b5ae35c7

@ -48,6 +48,7 @@ class EditTaskScreen(Screen):
"""
BINDINGS = [
Binding('ctrl+s', 'save', 'Save Changes', priority=True),
Binding('escape', 'exit', 'Exit Without Changes', priority=True),
]
def __init__(self,text):
"""
@ -82,6 +83,9 @@ class EditTaskScreen(Screen):
self.text.description = query.nodes[0].text
self.dismiss(self.text)
def action_exit(self):
self.dismiss(None)
class EditColScreen(Screen):
"""
This is a screen used to edit the name of a task
@ -267,6 +271,7 @@ class KanbanForm(App):
task and the board class
"""
if task:
icol, itask = self.get_col_task()
self.focused.highlighted_child.children[0].update(task.summary)
self.board.update_task(icol, itask, task)
@ -274,6 +279,7 @@ class KanbanForm(App):
def new_task(self, task):
""" This function adds a new task to our board
"""
if task:
icol,_ = self.get_col_task()
self.focused.mount(ListItem(Label(task.summary)))
self.board.add_task(icol, task)