widgets: ConfirmationView: Allow the widget to manage its own visibility

When the buttons are pressed then the widget should be dismissed. There
is no reason to make the caller handle that.

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2020-11-29 08:58:37 +00:00
parent 40ac92094e
commit 167173e9ba

View file

@ -354,8 +354,10 @@ class ConfirmationView:
)
if is_yes_button_press:
self.active = False
return True
elif is_no_button_press:
self.active = False
return False
else:
return None