single-line Panel/Layout possible? #1099
-
I have an existing curses application that needs to make the most of limited screen size. If I were to convert it to rich I'd need to be able to make single-line panels but I can't figure out how to collapse the area reserved for the border. Setting a Layout size < 3 results in the panel content disappearing. Is it possible? Here's an example where the from rich import print
from rich.layout import Layout
from rich.panel import Panel
layout = Layout(name="root")
info_panel = Panel("single-line info")
layout.split(
Layout(info_panel, name="info", size=1),
Layout(name="main")
)
layout["main"].split(
Layout(name="lists"),
Layout(name="io", ratio=2),
direction="horizontal"
)
status_panel = Panel("single-line status")
layout["io"].split(
Layout(status_panel, name="status", size=1),
Layout(name="log"),
)
layout["lists"].split(
Layout(name="devices"),
Layout(name="tasks"),
)
print(layout) |
Beta Was this translation helpful? Give feedback.
Answered by
willmcgugan
Mar 7, 2021
Replies: 1 comment 1 reply
-
Panels have a border around them. If you just want text, the use a plain string, or a |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
foozmeat
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Panels have a border around them. If you just want text, the use a plain string, or a
rich.text.Text
instance.