Try to center image (not working)

This commit is contained in:
Isaiah Odhner 2023-09-06 01:43:40 -04:00
parent 9140d14405
commit 32a10ab1d1
2 changed files with 14 additions and 2 deletions

View File

@ -2,4 +2,16 @@ GalleryItem {
layout: vertical;
width: 100%;
content-align: center middle;
align: center middle;
}
.image {
height: 1fr;
width: auto;
align: center middle;
}
.caption {
text-align: center;
background: blue;
color: yellow;
}

View File

@ -38,8 +38,8 @@ class GalleryItem(Vertical):
"""Add widgets to the layout."""
text = self.image.get_renderable()
text.no_wrap = True
yield Static(text)
yield Static(self.caption)
yield Static(text, classes="image")
yield Static(self.caption, classes="caption")
class GalleryApp(App[None]):
"""ANSI art gallery TUI"""