From 7c7706a2700bd02587f0c99ead9259674c6cfd99 Mon Sep 17 00:00:00 2001 From: David Kasakaitis Date: Mon, 2 Jun 2025 10:25:10 +0100 Subject: [PATCH 1/3] docs(Widget): remove outdated return header from `set_loading` method docstring This method was updated to use a different mechanism since its original implementation and the docstring remained unchanged. --- src/textual/widget.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/textual/widget.py b/src/textual/widget.py index 4e73d3799a..1252dd43a2 100644 --- a/src/textual/widget.py +++ b/src/textual/widget.py @@ -957,9 +957,6 @@ def set_loading(self, loading: bool) -> None: Args: loading: `True` to put the widget into a loading state, or `False` to reset the loading state. - - Returns: - An optional awaitable. """ LOADING_INDICATOR_CLASS = "-textual-loading-indicator" if loading: From 8fa56401a605ea691e9406e21f6fd3bb5bfeac0b Mon Sep 17 00:00:00 2001 From: David Kasakaitis Date: Mon, 2 Jun 2025 10:33:24 +0100 Subject: [PATCH 2/3] ref(Widget): move class name into method call --- src/textual/widget.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/textual/widget.py b/src/textual/widget.py index 1252dd43a2..a7eb24fab5 100644 --- a/src/textual/widget.py +++ b/src/textual/widget.py @@ -958,10 +958,9 @@ def set_loading(self, loading: bool) -> None: Args: loading: `True` to put the widget into a loading state, or `False` to reset the loading state. """ - LOADING_INDICATOR_CLASS = "-textual-loading-indicator" if loading: loading_indicator = self.get_loading_widget() - loading_indicator.add_class(LOADING_INDICATOR_CLASS) + loading_indicator.add_class("-textual-loading-indicator") self._cover(loading_indicator) else: self._uncover() From 4a8d37f6a02fe7d76e81219b0a8dfabc20b73e2a Mon Sep 17 00:00:00 2001 From: David Kasakaitis Date: Mon, 2 Jun 2025 10:37:21 +0100 Subject: [PATCH 3/3] docs(Widget): update `set_loading` extended description --- src/textual/widget.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/textual/widget.py b/src/textual/widget.py index a7eb24fab5..05d99addc3 100644 --- a/src/textual/widget.py +++ b/src/textual/widget.py @@ -953,7 +953,8 @@ def get_loading_widget(self) -> Widget: def set_loading(self, loading: bool) -> None: """Set or reset the loading state of this widget. - A widget in a loading state will display a LoadingIndicator that obscures the widget. + A widget in a loading state will display a `LoadingIndicator` or a custom widget + set through overriding the `get_loading_widget` method. Args: loading: `True` to put the widget into a loading state, or `False` to reset the loading state.