Skip to content

Commit 3483d81

Browse files
authored
Merge pull request #5833 from ddkasa/fix-set-loading-return-type-docstring
Update `Widget.set_loading` Docstring
2 parents d4d4f71 + 4a8d37f commit 3483d81

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/textual/widget.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -953,18 +953,15 @@ def get_loading_widget(self) -> Widget:
953953
def set_loading(self, loading: bool) -> None:
954954
"""Set or reset the loading state of this widget.
955955
956-
A widget in a loading state will display a LoadingIndicator that obscures the widget.
956+
A widget in a loading state will display a `LoadingIndicator` or a custom widget
957+
set through overriding the `get_loading_widget` method.
957958
958959
Args:
959960
loading: `True` to put the widget into a loading state, or `False` to reset the loading state.
960-
961-
Returns:
962-
An optional awaitable.
963961
"""
964-
LOADING_INDICATOR_CLASS = "-textual-loading-indicator"
965962
if loading:
966963
loading_indicator = self.get_loading_widget()
967-
loading_indicator.add_class(LOADING_INDICATOR_CLASS)
964+
loading_indicator.add_class("-textual-loading-indicator")
968965
self._cover(loading_indicator)
969966
else:
970967
self._uncover()

0 commit comments

Comments
 (0)