Textualize / trogon

Easily turn your Click CLI into a powerful terminal application
MIT License
2.5k stars 54 forks source link

Graphical oddities, especially highlighting round focused box (macOS) #95

Closed peterjc closed 3 weeks ago

peterjc commented 3 weeks ago

As per #94 I added TUI to this app https://github.com/pyani-plus/pyani-plus/commit/023a3625a9f4648dd900c6f7980f7f828894e76e with:

@app.command()
def tui(ctx: typer.Context):
    from typer.main import get_group
    from trogon import Trogon
    Trogon(get_group(app), click_context=ctx).run()

This works, but the TUI does not seem to be displaying like your screenshots.

I am using the default terminal app in macOS 12.7.6, here with font SF Mono and the left column highlighted (outlined in bright green):

Screenshot 2024-11-03 at 18 20 21

I have tried other fonts, e.g. Courier New - here with the focus on the search (outlined in pale blue):

Screenshot 2024-11-03 at 18 24 13

The left edge of the block highlighting is the most obvious visual glitch, but other little bits don't seem quite right either.

[I'm aware that ASCII art effectiveness varies in this macOS terminal, my use of SF Mono is in part as this looks good in Rich tables]

willmcgugan commented 3 weeks ago

This may help https://textual.textualize.io/FAQ/#why-doesnt-textual-look-good-on-macos

peterjc commented 3 weeks ago

That's it exactly, and yes, Menlo Regular font with a character spacing of 1 and line spacing of 0.805 is much better. Thank you.

I did suspect the "striping" was linked to vertical placement but hadn't thought of tweaking the line spacing.

This is food for thought when considering typical end users of what ever I'm working on.