Move disabled out of Button and into Widget

This doesn't go close to what #1748 is intending to do, but moves `disabled`
to where I want it and keeps `Button` working as before.
This commit is contained in:
Dave Pearson
2023-02-13 12:40:37 +00:00
parent 04c207627c
commit 7aaf884282
2 changed files with 2 additions and 3 deletions

View File

@@ -225,6 +225,8 @@ class Widget(DOMNode):
"""Rich renderable may shrink."""
auto_links = Reactive(True)
"""Widget will highlight links automatically."""
disabled = Reactive(False)
"""The disabled state of the widget. `True` if disabled, `False if not."""
hover_style: Reactive[Style] = Reactive(Style, repaint=False)
highlight_link_id: Reactive[str] = Reactive("")

View File

@@ -156,9 +156,6 @@ class Button(Static, can_focus=True):
variant = reactive("default")
"""The variant name for the button."""
disabled = reactive(False)
"""The disabled state of the button; `True` if disabled, `False` if not."""
class Pressed(Message, bubble=True):
"""Event sent when a `Button` is pressed.