Show tiny Paint icon ASCII art in Header (regardless of --ascii-only)

This commit is contained in:
Isaiah Odhner 2023-09-04 18:27:44 -04:00
parent 79b9c37c09
commit fea5cf8894
2 changed files with 17 additions and 0 deletions

View File

@ -3,6 +3,17 @@ Screen {
overflow: hidden;
}
/* Show brush handles (middle row of 3x3 icon) when header is collapsed */
/* :not() support would make this easier */
Header HeaderIcon {
/* offset: 0 -1; causes it to be invisible (bug?) */
margin-top: -1;
}
Header.-tall HeaderIcon {
/* offset: 0 0; */
margin-top: 0;
}
#paint {
layout: vertical;
}

View File

@ -32,6 +32,7 @@ from textual.strip import Strip
from textual.dom import DOMNode
from textual.widget import Widget
from textual.widgets import Button, Static, Input, Header, RadioSet, RadioButton
from textual.widgets._header import HeaderIcon
from textual.binding import Binding
from textual.color import Color, ColorParseError
from PIL import Image, UnidentifiedImageError
@ -5246,6 +5247,11 @@ if args.ascii_only:
RadioButton.BUTTON_INNER = "*" # "*", "o", "O", "@"
# HeaderIcon.icon = "[on white][blue]\\\\[/][red]|[/][yellow]/[/][/]"
HeaderIcon.icon = "[black]..,[/]\n[blue]\\\\[/][on white][red]|[/][yellow]/[/][/]\n[black on rgb(192,192,192)]\\[_][/]"
# HeaderIcon.icon = "[black]..,[/]\n[blue]\\\\[/][on white][red]|[/][yellow]/[/][/]\n[black on rgb(192,192,192)]\\[][on white] [/][/]"
# HeaderIcon.icon = "[black]...[/]\n[on white][blue]\\\\[/][red]|[/][yellow]/[/][/]\n[black on rgb(192,192,192)]\\[][on white] [/][/]"
# `textual run --dev src.textual_paint.paint` will search for a
# global variable named `app`, and fallback to