Adding upstream version 4.0.4.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
1f832614e9
commit
0832c185c0
48 changed files with 7595 additions and 0 deletions
39
examples/left_column_styling.py
Normal file
39
examples/left_column_styling.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
from textual.app import App, ComposeResult
|
||||
from textual.content import Content
|
||||
from textual.widgets import Input
|
||||
|
||||
from textual_autocomplete import AutoComplete, DropdownItem
|
||||
|
||||
|
||||
LANGUAGES = [
|
||||
DropdownItem(
|
||||
"Python",
|
||||
prefix=Content.from_markup("[$text-success on $success-muted] 🐍 "),
|
||||
),
|
||||
DropdownItem(
|
||||
"Golang",
|
||||
prefix=Content.from_markup("[$text-primary on $primary-muted] 🔷 "),
|
||||
),
|
||||
DropdownItem("Java", prefix=Content.from_markup("[#6a2db5 on magenta 20%] ☕ ")),
|
||||
DropdownItem(
|
||||
"Rust", prefix=Content.from_markup("[$text-accent on $accent-muted] 🦀 ")
|
||||
),
|
||||
]
|
||||
|
||||
|
||||
class LanguagesSearchApp(App[None]):
|
||||
CSS = """
|
||||
Input {
|
||||
margin: 2 4;
|
||||
}
|
||||
"""
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
input_widget = Input(placeholder="Search for a programming language...")
|
||||
yield input_widget
|
||||
yield AutoComplete(target=input_widget, candidates=LANGUAGES)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = LanguagesSearchApp()
|
||||
app.run()
|
Loading…
Add table
Add a link
Reference in a new issue