Skip to content
Discussion options

You must be logged in to vote

The ContentSwitcher has height auto by default, which means it will grow with the content. That's what may have changed since 0.32.0.

To make the ContentSwitcher only take up the remaining space in its container, you can set its height to 1fr. I think this will give you the effect you are looking for:

from textual.app import App
from textual.widgets import Label, Button, Footer, ContentSwitcher
from textual.containers import VerticalScroll, Horizontal


class TestApp(App):
    CSS = """
    Screen {
        overflow-y: hidden;
    }

    Button {
        max-height: 1;
        border: none;
        width: 1fr;
    }

    .horz {
        height: 1;
        align: center middle;
    }

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@learnbyexample
Comment options

Answer selected by learnbyexample
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants