From 3944a6e40412744c6c5b7ed3e6650899f0980f65 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Sun, 17 Sep 2023 00:35:51 -0400 Subject: [PATCH] Update textual to 0.31.0 DataTable now has `max-height: 100%` by default, which breaks my layout. --- requirements.txt | 2 +- src/textual_paint/paint.css | 3 +++ src/textual_paint/paint.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index ec7018d..3ee9938 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ pyperclip==1.8.2 pyxdg==0.28 # xdg module, used for wallpaper setting; optional, falls back to ~/.config rich==13.3.5 stransi==0.3.0 -textual==0.30.0 +textual==0.31.0 textual-dev==1.0.0 # for development (`textual` CLI) watchdog==3.0.0 # for development; optional (only used when --restart-on-changes is passed) types-Pillow==10.0.0.1 # for development diff --git a/src/textual_paint/paint.css b/src/textual_paint/paint.css index 6fba459..4abcc18 100644 --- a/src/textual_paint/paint.css +++ b/src/textual_paint/paint.css @@ -262,6 +262,9 @@ FileDialogWindow .window_content Button { CharacterSelectorDialogWindow DataTable { width: auto; + /* textual 0.31.0 adds `max-height: 100%` to DataTable */ + /* `unset` is not supported */ + max-height: 10000; } CharacterSelectorDialogWindow .ok, CharacterSelectorDialogWindow .cancel { diff --git a/src/textual_paint/paint.py b/src/textual_paint/paint.py index d748f31..1dc6781 100755 --- a/src/textual_paint/paint.py +++ b/src/textual_paint/paint.py @@ -1447,7 +1447,7 @@ Columns: {len(self.palette) // 2} """Center the image as the wallpaper.""" self.set_as_wallpaper(tiled=False) # worker thread helps keep the UI responsive - @work(exclusive=True) + @work(exclusive=True, thread=True) def set_as_wallpaper(self, tiled: bool) -> None: """Set the image as the wallpaper.""" try: