mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Merge branch 'main' into multiselect
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from textual.app import App
|
||||
from textual.containers import Horizontal
|
||||
from textual.widgets import Placeholder, Label, Static
|
||||
from textual.widgets import Label, Placeholder, Static
|
||||
|
||||
|
||||
class Ruler(Static):
|
||||
@@ -9,7 +9,7 @@ class Ruler(Static):
|
||||
yield Label(ruler_text)
|
||||
|
||||
|
||||
class HeightComparisonApp(App):
|
||||
class WidthComparisonApp(App):
|
||||
def compose(self):
|
||||
yield Horizontal(
|
||||
Placeholder(id="cells"), # (1)!
|
||||
@@ -25,4 +25,6 @@ class HeightComparisonApp(App):
|
||||
yield Ruler()
|
||||
|
||||
|
||||
app = HeightComparisonApp(css_path="width_comparison.css")
|
||||
app = WidthComparisonApp(css_path="width_comparison.css")
|
||||
if __name__ == "__main__":
|
||||
app.run()
|
||||
|
||||
@@ -87,7 +87,7 @@ tables](https://rich.readthedocs.io/en/latest/tables.html):
|
||||
|
||||
## Messages
|
||||
|
||||
- [OptionList.OptionHighlight][textual.widgets.OptionList.OptionHighlighted]
|
||||
- [OptionList.OptionHighlighted][textual.widgets.OptionList.OptionHighlighted]
|
||||
- [OptionList.OptionSelected][textual.widgets.OptionList.OptionSelected]
|
||||
|
||||
Both of the messages above inherit from the common base [`OptionList`][textual.widgets.OptionList.OptionMessage], so refer to its documentation to see what attributes are available.
|
||||
@@ -115,3 +115,8 @@ The option list provides the following component classes:
|
||||
::: textual.widgets.OptionList
|
||||
options:
|
||||
heading_level: 2
|
||||
|
||||
|
||||
::: textual.widgets.option_list.Option
|
||||
options:
|
||||
heading_level: 2
|
||||
|
||||
@@ -66,10 +66,10 @@ The following example presents a `Select` with a number of options.
|
||||
## Reactive attributes
|
||||
|
||||
|
||||
| Name | Type | Default | Description |
|
||||
| ---------- | -------------------- | ------- | ----------------------------------- |
|
||||
| `expanded` | `bool` | `False` | True to expand the options overlay. |
|
||||
| `value` | `SelectType \| None` | `None` | Current value of the Select. |
|
||||
| Name | Type | Default | Description |
|
||||
|------------|------------------------|---------|-------------------------------------|
|
||||
| `expanded` | `bool` | `False` | True to expand the options overlay. |
|
||||
| `value` | `SelectType` \| `None` | `None` | Current value of the Select. |
|
||||
|
||||
|
||||
## Bindings
|
||||
|
||||
Reference in New Issue
Block a user