TabbedContent Width seems to be always 100%. #5566
-
I got a two column layout, left got a tree element and the right got a further divided Panel, it might look exactly like this: The first tab is a datatable and it contains more entries than are visible. Only the tree widget got a fixed width of 32, if it had none it would just stop existing. The datatable should have a scrollbar but just doesnt. If i set the width of the tabbedContent Container manually there is one. It seems like the widget is either always 100% of the width, regardless of what else is present, or I am just bad at tcss and my partially defined arrangement is not suitable. My goal was to have a fixed tree on the left and the rest of the view is the tabbed stuff, so either a datatable or the notes in markdown. For now this works but I just spend 30 minutes fiddling with tcss and adding/removing containers and nothing seem to change the fact that the TabbedContent Thing is egoistic. If you must look at the full horror, it is here: https://github.com/BurnoutDV/EpisodeNames inside What is it I am doing wrong? with Horizontal():
yield Tree("Project", id="project_tree", classes="sidebar")
with TabbedContent(id="tabs"):
with TabPane(i18n['Episodes'], id='tab_episode'):
with ScrollableContainer(can_focus=False): #? stop gap measure to restore scrollability
DataTable(id="entryview", zebra_stripes=True, cursor_type="row")
with TabPane(i18n['Project Notes']):
yield MarkdownViewer(id='project_notes', show_table_of_contents=False)
with TabPane(i18n['All Notes']):
yield MarkdownViewer(id="combined_view", show_table_of_contents=False) relevant classes .sidebar {
width: 32;
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
5 Minutes after I contemplated for 2 hours whether to write or not I had the bright idea to use |
Beta Was this translation helpful? Give feedback.
Try setting the outer most widget to width 1fr. https://textual.textualize.io/how-to/design-a-layout/