mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-22 06:11:37 +03:00
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!
This commit is contained in:
parent
48f0303a54
commit
986db57e17
7
paint.py
7
paint.py
@ -1770,12 +1770,7 @@ class PaintApp(App):
|
|||||||
widget.styles.background = Color.from_hsl(i / 10, 1, 0.3)
|
widget.styles.background = Color.from_hsl(i / 10, 1, 0.3)
|
||||||
if not event.ctrl:
|
if not event.ctrl:
|
||||||
widget.styles.border = ("round", Color.from_hsl(i / 10, 1, 0.5))
|
widget.styles.border = ("round", Color.from_hsl(i / 10, 1, 0.5))
|
||||||
title = widget.__class__.__name__
|
widget.border_title = widget.css_identifier_styled
|
||||||
if widget.id:
|
|
||||||
title += "#" + widget.id
|
|
||||||
if widget.classes:
|
|
||||||
title += "." + ".".join(widget.classes)
|
|
||||||
widget.border_title = title
|
|
||||||
|
|
||||||
# `textual run --dev paint.py` will search for a
|
# `textual run --dev paint.py` will search for a
|
||||||
# global variable named `app`, and fallback to
|
# global variable named `app`, and fallback to
|
||||||
|
Loading…
Reference in New Issue
Block a user