mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Swap the checkbox to using an actual check mark
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
"""Provides a check box widget."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ._toggle import ToggleButton
|
||||
|
||||
|
||||
@@ -11,3 +13,26 @@ class Checkbox(ToggleButton):
|
||||
|
||||
# https://github.com/Textualize/textual/issues/1814
|
||||
namespace = "checkbox"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
label: str,
|
||||
value: bool = False,
|
||||
button_first: bool = True,
|
||||
*,
|
||||
name: str | None = None,
|
||||
id: str | None = None,
|
||||
classes: str | None = None,
|
||||
):
|
||||
"""Initialise the radio button.
|
||||
|
||||
Args:
|
||||
label: The label for the toggle.
|
||||
value: The initial value of the checkbox. Defaults to `False`.
|
||||
button_first: Should the button come before the label, or after?
|
||||
name: The name of the checkbox.
|
||||
id: The ID of the checkbox in the DOM.
|
||||
classes: The CSS classes of the checkbox.
|
||||
"""
|
||||
super().__init__(label, value, button_first, name=name, id=id, classes=classes)
|
||||
self.button_on = "✓"
|
||||
|
||||
Reference in New Issue
Block a user