mirror of
https://github.com/1j01/textual-paint.git
synced 2024-12-30 10:12:01 +03:00
Ctrl+MMB to colorize without adding borders to inspect layout without modifying it
This commit is contained in:
parent
4ee5efe85c
commit
0125374bba
15
paint.py
15
paint.py
@ -1200,13 +1200,14 @@ class PaintApp(App):
|
||||
for i, widget in enumerate(leaf_widget.ancestors_with_self):
|
||||
self.debug_highlight.append((widget, widget.styles.background, widget.styles.border, widget.border_title if hasattr(widget, "border_title") else None))
|
||||
widget.styles.background = Color.from_hsl(i / 10, 1, 0.3)
|
||||
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
|
||||
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
|
||||
|
||||
# `textual run --dev paint.py` will search for a
|
||||
# global variable named `app`, and fallback to
|
||||
|
Loading…
Reference in New Issue
Block a user