can we make textual widgets thinner? #4864
-
the textual button, checkbox, etc always take multiple lines, this make the interface waste lots of space. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
https://textual.textualize.io/widgets/button/#additional-notes You need to also style from textual.app import App, ComposeResult
from textual.containers import Horizontal
from textual.widgets import Button
class Toolbar(Horizontal):
DEFAULT_CSS = """
Toolbar {
height: 1;
margin: 0;
align: center middle;
}
Toolbar Button {
margin: 0 1 0 0;
padding: 0;
height: 1;
border: none;
background: $primary;
color: $text;
text-style: none;
&:hover {
text-style: bold;
padding: 0;
border: none;
background: $accent;
}
}
"""
class MyApp(App):
def compose(self) -> ComposeResult:
with Toolbar():
yield Button("A")
yield Button("B")
yield Button("C")
if __name__ == "__main__":
app = MyApp()
app.run() |
Beta Was this translation helpful? Give feedback.
-
Most of the controls have a border, which you can remove with a few lines of CSS. |
Beta Was this translation helpful? Give feedback.
Most of the controls have a border, which you can remove with a few lines of CSS.