From 986db57e1741b7c2b262422292321f14af78f9e6 Mon Sep 17 00:00:00 2001 From: Isaiah Odhner Date: Thu, 20 Apr 2023 20:50:13 -0400 Subject: [PATCH] Improve layout inspector with built in `css_identifier_styled` It now shows [name=...] if applicable, and styles each part differently. And it's less code! --- paint.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/paint.py b/paint.py index 31482f0..6f041d8 100644 --- a/paint.py +++ b/paint.py @@ -1770,12 +1770,7 @@ class PaintApp(App): widget.styles.background = Color.from_hsl(i / 10, 1, 0.3) if not event.ctrl: widget.styles.border = ("round", Color.from_hsl(i / 10, 1, 0.5)) - title = widget.__class__.__name__ - if widget.id: - title += "#" + widget.id - if widget.classes: - title += "." + ".".join(widget.classes) - widget.border_title = title + widget.border_title = widget.css_identifier_styled # `textual run --dev paint.py` will search for a # global variable named `app`, and fallback to