Add a method for toggling all options

This commit is contained in:
Dave Pearson
2023-05-23 10:26:16 +01:00
parent a4148d028b
commit db273ea9ff

View File

@@ -331,6 +331,10 @@ class SelectionList(Generic[SelectionType], OptionList):
self.refresh() self.refresh()
return self return self
def toggle_all(self) -> Self:
"""Toggle all items."""
return self._apply_to_all(self._toggle)
def _make_selection( def _make_selection(
self, self,
selection: tuple[TextType, SelectionType] selection: tuple[TextType, SelectionType]