feat(ui): ✨ Layout our search results more correctly
This commit is contained in:
parent
4fbee9dfee
commit
8999f5a52f
1 changed files with 14 additions and 4 deletions
|
|
@ -14,11 +14,12 @@ from textual.widgets import (
|
||||||
Footer,
|
Footer,
|
||||||
Header,
|
Header,
|
||||||
Input,
|
Input,
|
||||||
|
Static,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@final
|
@final
|
||||||
class SearchBar(Widget):
|
class SearchBar(Static):
|
||||||
DEFAULT_CSS = """
|
DEFAULT_CSS = """
|
||||||
#teilchen-input {
|
#teilchen-input {
|
||||||
width: 4fr;
|
width: 4fr;
|
||||||
|
|
@ -30,7 +31,7 @@ class SearchBar(Widget):
|
||||||
|
|
||||||
@override
|
@override
|
||||||
def compose(self) -> ComposeResult:
|
def compose(self) -> ComposeResult:
|
||||||
with Horizontal(id="search-bar-widget"):
|
with HorizontalGroup(id="search-bar-widget"):
|
||||||
yield Input(
|
yield Input(
|
||||||
placeholder="Enter Teilchen information: name, description, #tags",
|
placeholder="Enter Teilchen information: name, description, #tags",
|
||||||
tooltip=(
|
tooltip=(
|
||||||
|
|
@ -41,8 +42,17 @@ class SearchBar(Widget):
|
||||||
id="teilchen-input",
|
id="teilchen-input",
|
||||||
type="text",
|
type="text",
|
||||||
)
|
)
|
||||||
yield Button("Add", variant="success", id="button-add")
|
yield Button(
|
||||||
yield Button("Search", variant="default", id="button-search")
|
"Add", variant="success", classes="search-bar-buttons", id="button-add"
|
||||||
|
)
|
||||||
|
yield Button(
|
||||||
|
"Search",
|
||||||
|
variant="default",
|
||||||
|
classes="search-bar-buttons",
|
||||||
|
id="button-search",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
TeilchenDatum = tuple[int, str, str, str, str]
|
TeilchenDatum = tuple[int, str, str, str, str]
|
||||||
TeilchenHeader = tuple[
|
TeilchenHeader = tuple[
|
||||||
Literal["pk"],
|
Literal["pk"],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue