mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Some experimenting with using the widget in different ways
This commit is contained in:
@@ -20,6 +20,7 @@ class InputApp(App[str]):
|
||||
text_boxes = Widget(self.fahrenheit, self.celsius)
|
||||
self.mount(inputs=text_boxes)
|
||||
self.mount(spacer=Widget())
|
||||
self.mount(footer=TextInput(placeholder="Footer Search Bar"))
|
||||
self.mount(text_area=TextArea())
|
||||
|
||||
def handle_changed(self, event: TextWidgetBase.Changed) -> None:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
App {
|
||||
background: $secondary;
|
||||
}
|
||||
@@ -25,17 +24,32 @@ Screen {
|
||||
|
||||
#inputs {
|
||||
dock: top;
|
||||
layout: horizontal;
|
||||
background: $primary;
|
||||
height: 3;
|
||||
}
|
||||
|
||||
#body {
|
||||
dock: top;
|
||||
background: $secondary;
|
||||
height: 20;
|
||||
layout: horizontal;
|
||||
}
|
||||
|
||||
#text_area {
|
||||
dock: bottom;
|
||||
}
|
||||
|
||||
|
||||
/* Not ideal having to do this to get a single cell height text input,
|
||||
which will probably be a common use-case */
|
||||
#footer {
|
||||
dock: bottom;
|
||||
height: 1;
|
||||
padding: 0;
|
||||
border: ;
|
||||
}
|
||||
|
||||
#footer > TextInputChild {
|
||||
border: ;
|
||||
padding: 0;
|
||||
height: 1;
|
||||
}
|
||||
|
||||
#footer > TextInputChild:focus {
|
||||
padding: 0;
|
||||
border: ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user