From ccf4f06a741f72b7a84c252ad7ddb1c1e2f69ec8 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Fri, 21 Apr 2023 07:57:48 +0100 Subject: [PATCH] Some more Button docs tidying While I'm in this file... might as well link the word "variant" to the type that it's referring to. --- src/textual/widgets/_button.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/textual/widgets/_button.py b/src/textual/widgets/_button.py index bcac77b91..e47797ba3 100644 --- a/src/textual/widgets/_button.py +++ b/src/textual/widgets/_button.py @@ -16,7 +16,7 @@ from ..widgets import Static ButtonVariant = Literal["default", "primary", "success", "warning", "error"] """The names of the valid button variants. -These are the variants that can be used with a [Button][textual.widgets.Button]. +These are the variants that can be used with a [`Button`][textual.widgets.Button]. """ _VALID_BUTTON_VARIANTS = {"default", "primary", "success", "warning", "error"} @@ -281,7 +281,8 @@ class Button(Static, can_focus=True): disabled: Whether the button is disabled or not. Returns: - A Button widget of the 'success' variant. + A [`Button`][textual.widgets.Button] widget of the 'success' + [variant][textual.widgets.button.ButtonVariant]. """ return Button( label=label, @@ -313,7 +314,8 @@ class Button(Static, can_focus=True): disabled: Whether the button is disabled or not. Returns: - A Button widget of the 'warning' variant. + A [`Button`][textual.widgets.Button] widget of the 'warning' + [variant][textual.widgets.button.ButtonVariant]. """ return Button( label=label, @@ -345,7 +347,8 @@ class Button(Static, can_focus=True): disabled: Whether the button is disabled or not. Returns: - A Button widget of the 'error' variant. + A [`Button`][textual.widgets.Button] widget of the 'error' + [variant][textual.widgets.button.ButtonVariant]. """ return Button( label=label,