Add bindings and component classes to reference pages.

This commit is contained in:
Rodrigo Girão Serrão
2023-01-25 15:19:16 +00:00
parent b63e2366e1
commit ef779d71dd
7 changed files with 93 additions and 2 deletions

View File

@@ -46,11 +46,27 @@ The `Checkbox.Changed` message is sent when the checkbox is toggled.
| --------- | ------ | ------------------------------ | | --------- | ------ | ------------------------------ |
| `value` | `bool` | The new value of the checkbox. | | `value` | `bool` | The new value of the checkbox. |
## Bindings
The checkbox widget defines directly the following bindings:
::: textual.widgets.Checkbox.BINDINGS
options:
show_root_heading: false
show_root_toc_entry: false
## Component Classes
The checkbox widget provides the following component classes:
::: textual.widgets.Checkbox.COMPONENT_CLASSES
options:
show_root_heading: false
show_root_toc_entry: false
## Additional Notes ## Additional Notes
- To remove the spacing around a checkbox, set `border: none;` and `padding: 0;`. - To remove the spacing around a checkbox, set `border: none;` and `padding: 0;`.
- The `.checkbox--switch` component class can be used to change the color and background of the switch.
- When focused, the ++enter++ or ++space++ keys can be used to toggle the checkbox.
## See Also ## See Also

View File

@@ -48,6 +48,24 @@ The example below populates a table with CSV data.
### ::: textual.widgets.DataTable.ColumnSelected ### ::: textual.widgets.DataTable.ColumnSelected
## Bindings
The data table widget defines directly the following bindings:
::: textual.widgets.DataTable.BINDINGS
options:
show_root_heading: false
show_root_toc_entry: false
## Component Classes
The data table widget provides the following component classes:
::: textual.widgets.DataTable.COMPONENT_CLASSES
options:
show_root_heading: false
show_root_toc_entry: false
## See Also ## See Also
* [DataTable][textual.widgets.DataTable] code reference * [DataTable][textual.widgets.DataTable] code reference

View File

@@ -36,6 +36,14 @@ The `DirectoryTree.FileSelected` message is sent when the user selects a file in
| `show_guides` | `bool` | `True` | Show guide lines between levels. | | `show_guides` | `bool` | `True` | Show guide lines between levels. |
| `guide_depth` | `int` | `4` | Amount of indentation between parent and child. | | `guide_depth` | `int` | `4` | Amount of indentation between parent and child. |
## Component Classes
The directory tree widget provides the following component classes:
::: textual.widgets.DirectoryTree.COMPONENT_CLASSES
options:
show_root_heading: false
show_root_toc_entry: false
## See Also ## See Also

View File

@@ -32,6 +32,15 @@ widget. Notice how the `Footer` automatically displays the keybinding.
This widget sends no messages. This widget sends no messages.
## Component Classes
The footer widget provides the following component classes:
::: textual.widgets.Footer.COMPONENT_CLASSES
options:
show_root_heading: false
show_root_toc_entry: false
## Additional Notes ## Additional Notes
* You can prevent keybindings from appearing in the footer by setting the `show` argument of the `Binding` to `False`. * You can prevent keybindings from appearing in the footer by setting the `show` argument of the `Binding` to `False`.

View File

@@ -57,6 +57,23 @@ The `Input.Submitted` message is sent when you press ++enter++ with the text fie
| --------- | ----- | -------------------------------- | | --------- | ----- | -------------------------------- |
| `value` | `str` | The new value in the text input. | | `value` | `str` | The new value in the text input. |
## Bindings
The input widget defines directly the following bindings:
::: textual.widgets.Input.BINDINGS
options:
show_root_heading: false
show_root_toc_entry: false
## Component Classes
The input widget provides the following component classes:
::: textual.widgets.Input.COMPONENT_CLASSES
options:
show_root_heading: false
show_root_toc_entry: false
## Additional Notes ## Additional Notes

View File

@@ -63,6 +63,14 @@ or by clicking on it.
| --------- | ---------- | --------------------------- | | --------- | ---------- | --------------------------- |
| `item` | `ListItem` | The item that was selected. | | `item` | `ListItem` | The item that was selected. |
## Bindings
The list view widget defines directly the following bindings:
::: textual.widgets.ListView.BINDINGS
options:
show_root_heading: false
show_root_toc_entry: false
## See Also ## See Also

View File

@@ -71,8 +71,23 @@ The `Tree.NodeCollapsed` message is sent when the user expands a node in the tre
| --------- | ------------------------------------ | --------------- | | --------- | ------------------------------------ | --------------- |
| `node` | [TreeNode][textual.widgets.TreeNode] | Collapsed node. | | `node` | [TreeNode][textual.widgets.TreeNode] | Collapsed node. |
## Bindings
The tree widget defines directly the following bindings:
::: textual.widgets.Tree.BINDINGS
options:
show_root_heading: false
show_root_toc_entry: false
## Component Classes
The tree widget provides the following component classes:
::: textual.widgets.Tree.COMPONENT_CLASSES
options:
show_root_heading: false
show_root_toc_entry: false
## See Also ## See Also