Some experimenting with using the widget in different ways

This commit is contained in:
Darren Burns
2022-05-12 16:22:35 +01:00
parent c34973ce80
commit 4a5db9b4b0
2 changed files with 23 additions and 8 deletions

View File

@@ -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:

View File

@@ -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: ;
}