tweaks and fixes

This commit is contained in:
Will McGugan
2022-10-05 09:26:39 +01:00
parent d98d889dd1
commit b246278233
6 changed files with 8 additions and 18 deletions

View File

@@ -1,6 +1,5 @@
# Button # Button
## Description
A simple button widget which can be pressed using a mouse click or by pressing ++return++ A simple button widget which can be pressed using a mouse click or by pressing ++return++
when it has focus. when it has focus.
@@ -33,7 +32,7 @@ Clicking any of the non-disabled buttons in the example app below will result in
## Reactive Attributes ## Reactive Attributes
| Name | Type | Default | Description | | Name | Type | Default | Description |
|------------|--------|-------------|-----------------------------------------------------------------------------------------------------------------------------------| | ---------- | ------ | ----------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `label` | `str` | `""` | The text that appears inside the button. | | `label` | `str` | `""` | The text that appears inside the button. |
| `variant` | `str` | `"default"` | Semantic styling variant. One of `default`, `primary`, `success`, `warning`, `error`. | | `variant` | `str` | `"default"` | Semantic styling variant. One of `default`, `primary`, `success`, `warning`, `error`. |
| `disabled` | `bool` | `False` | Whether the button is disabled or not. Disabled buttons cannot be focused or clicked, and are styled in a way that suggests this. | | `disabled` | `bool` | `False` | Whether the button is disabled or not. Disabled buttons cannot be focused or clicked, and are styled in a way that suggests this. |

View File

@@ -1,7 +1,5 @@
# Footer # Footer
## Description
A simple footer widget which is docked to the bottom of its parent container. Displays A simple footer widget which is docked to the bottom of its parent container. Displays
available keybindings for the currently focused widget. available keybindings for the currently focused widget.
@@ -27,7 +25,7 @@ widget. Notice how the `Footer` automatically displays the keybind.
## Reactive Attributes ## Reactive Attributes
| Name | Type | Default | Description | | Name | Type | Default | Description |
|-----------------|-------|---------|-----------------------------------------------------------------------------------------------------------| | --------------- | ----- | ------- | --------------------------------------------------------------------------------------------------------- |
| `highlight_key` | `str` | `None` | Stores the currently highlighted key. This is typically the key the cursor is hovered over in the footer. | | `highlight_key` | `str` | `None` | Stores the currently highlighted key. This is typically the key the cursor is hovered over in the footer. |
## Messages ## Messages

View File

@@ -1,7 +1,5 @@
# Header # Header
## Description
A simple header widget which docks itself to the top of the parent container. A simple header widget which docks itself to the top of the parent container.
- [ ] Focusable - [ ] Focusable
@@ -25,7 +23,7 @@ The example below shows an app with a `Header`.
## Reactive Attributes ## Reactive Attributes
| Name | Type | Default | Description | | Name | Type | Default | Description |
|--------|--------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ------ | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `tall` | `bool` | `True` | Whether the `Header` widget is displayed as tall or not. The tall variant is 3 cells tall by default. The non-tall variant is a single cell tall. This can be toggled by clicking on the header. | | `tall` | `bool` | `True` | Whether the `Header` widget is displayed as tall or not. The tall variant is 3 cells tall by default. The non-tall variant is a single cell tall. This can be toggled by clicking on the header. |
## Messages ## Messages

View File

@@ -1,7 +1,5 @@
# Input # Input
## Description
A single-line text input widget. A single-line text input widget.
- [x] Focusable - [x] Focusable
@@ -13,7 +11,7 @@ The example below shows how you might create a simple form using two `Input` wid
=== "Output" === "Output"
```{.textual path="docs/examples/widgets/input.py"} ```{.textual path="docs/examples/widgets/input.py" press="tab,D,a,r,r,e,n"}
``` ```
=== "input.py" === "input.py"
@@ -25,7 +23,7 @@ The example below shows how you might create a simple form using two `Input` wid
## Reactive Attributes ## Reactive Attributes
| Name | Type | Default | Description | | Name | Type | Default | Description |
|-------------------|--------|---------|-----------------------------------------------------------------| | ----------------- | ------ | ------- | --------------------------------------------------------------- |
| `cursor_blink` | `bool` | `True` | True if cursor blinking is enabled. | | `cursor_blink` | `bool` | `True` | True if cursor blinking is enabled. |
| `value` | `str` | `""` | The value currently in the text input. | | `value` | `str` | `""` | The value currently in the text input. |
| `cursor_position` | `int` | `0` | The index of the cursor in the value string. | | `cursor_position` | `int` | `0` | The index of the cursor in the value string. |
@@ -43,7 +41,7 @@ The `Input.Changed` message is sent when the value in the text input changes.
#### Attributes #### Attributes
| attribute | type | purpose | | attribute | type | purpose |
|-----------|-------|----------------------------------| | --------- | ----- | -------------------------------- |
| `value` | `str` | The new value in the text input. | | `value` | `str` | The new value in the text input. |
@@ -56,7 +54,7 @@ The `Input.Submitted` message is sent when you press ++enter++ with the text fie
#### Attributes #### Attributes
| attribute | type | purpose | | attribute | type | purpose |
|-----------|-------|----------------------------------| | --------- | ----- | -------------------------------- |
| `value` | `str` | The new value in the text input. | | `value` | `str` | The new value in the text input. |

View File

@@ -1,8 +1,6 @@
# Static # Static
## Description A widget which displays static content.
A widget which displays a static renderable content.
Can be used for simple text labels, but can also contain more complex Rich renderables. Can be used for simple text labels, but can also contain more complex Rich renderables.
- [ ] Focusable - [ ] Focusable

View File

@@ -93,7 +93,6 @@ nav:
- "widgets/index.md" - "widgets/index.md"
- "widgets/input.md" - "widgets/input.md"
- "widgets/static.md" - "widgets/static.md"
- "widgets/input.md"
- "widgets/tree_control.md" - "widgets/tree_control.md"
- Reference: - Reference:
- "reference/app.md" - "reference/app.md"