Skip to content

Commit e656284

Browse files
Fix docstring for some widget optional arguments. (#1204)
* Update _button.py * Update tabs.py
1 parent 3767057 commit e656284

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/textual/widgets/_button.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ def __init__(
168168
"""Create a Button widget.
169169
170170
Args:
171-
label (str): The text that appears within the button.
172-
disabled (bool): Whether the button is disabled or not.
173-
variant (ButtonVariant): The variant of the button.
171+
label (str, optional): The text that appears within the button.
172+
disabled (bool, optional): Whether the button is disabled or not.
173+
variant (ButtonVariant, optional): The variant of the button.
174174
name (str | None, optional): The name of the button.
175175
id (str | None, optional): The ID of the button in the DOM.
176176
classes (str | None, optional): The CSS classes of the button.
@@ -267,8 +267,8 @@ def success(
267267
"""Utility constructor for creating a success Button variant.
268268
269269
Args:
270-
label (str): The text that appears within the button.
271-
disabled (bool): Whether the button is disabled or not.
270+
label (str, optional): The text that appears within the button.
271+
disabled (bool, optional): Whether the button is disabled or not.
272272
name (str | None, optional): The name of the button.
273273
id (str | None, optional): The ID of the button in the DOM.
274274
classes(str | None, optional): The CSS classes of the button.
@@ -298,8 +298,8 @@ def warning(
298298
"""Utility constructor for creating a warning Button variant.
299299
300300
Args:
301-
label (str): The text that appears within the button.
302-
disabled (bool): Whether the button is disabled or not.
301+
label (str, optional): The text that appears within the button.
302+
disabled (bool, optional): Whether the button is disabled or not.
303303
name (str | None, optional): The name of the button.
304304
id (str | None, optional): The ID of the button in the DOM.
305305
classes (str | None, optional): The CSS classes of the button.
@@ -329,8 +329,8 @@ def error(
329329
"""Utility constructor for creating an error Button variant.
330330
331331
Args:
332-
label (str): The text that appears within the button.
333-
disabled (bool): Whether the button is disabled or not.
332+
label (str, optional): The text that appears within the button.
333+
disabled (bool, optional): Whether the button is disabled or not.
334334
name (str | None, optional): The name of the button.
335335
id (str | None, optional): The ID of the button in the DOM.
336336
classes (str | None, optional): The CSS classes of the button.

src/textual/widgets/tabs.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,16 @@ class Tabs(Widget):
177177
Args:
178178
tabs (list[Tab]): A list of Tab objects defining the tabs which should be rendered.
179179
active_tab (str, optional): The name of the tab that should be active on first render.
180-
active_tab_style (StyleType): Style to apply to the label of the active tab.
181-
active_bar_style (StyleType): Style to apply to the underline of the active tab.
182-
inactive_tab_style (StyleType): Style to apply to the label of inactive tabs.
183-
inactive_bar_style (StyleType): Style to apply to the underline of inactive tabs.
184-
inactive_text_opacity (float): Opacity of the text labels of inactive tabs.
185-
animation_duration (float): The duration of the tab change animation, in seconds.
186-
animation_function (str): The easing function to use for the tab change animation.
180+
active_tab_style (StyleType, optional): Style to apply to the label of the active tab.
181+
active_bar_style (StyleType, optional): Style to apply to the underline of the active tab.
182+
inactive_tab_style (StyleType, optional): Style to apply to the label of inactive tabs.
183+
inactive_bar_style (StyleType, optional): Style to apply to the underline of inactive tabs.
184+
inactive_text_opacity (float, optional): Opacity of the text labels of inactive tabs.
185+
animation_duration (float, optional): The duration of the tab change animation, in seconds.
186+
animation_function (str, optional): The easing function to use for the tab change animation.
187187
tab_padding (int, optional): The padding at the side of each tab. If None, tabs will
188188
automatically be padded such that they fit the available horizontal space.
189-
search_by_first_character (bool): If True, entering a character on your keyboard
189+
search_by_first_character (bool, optional): If True, entering a character on your keyboard
190190
will activate the next tab (in left-to-right order) with a label starting with
191191
that character.
192192
"""

0 commit comments

Comments
 (0)