Skip to content

feat(theme): implement UTF-8 checkbox and radiobox - #514

Merged
ceccopierangiolieugenio merged 2 commits into
ceccopierangiolieugenio:mainfrom
slook:theme-checkbox-radiobox
Nov 8, 2025
Merged

feat(theme): implement UTF-8 checkbox and radiobox#514
ceccopierangiolieugenio merged 2 commits into
ceccopierangiolieugenio:mainfrom
slook:theme-checkbox-radiobox

Conversation

@slook

@slook slook commented Nov 8, 2025

Copy link
Copy Markdown
Contributor
  • Changed: Use UTF-8 glyphs for TTkCheckBox and TTkRadioButton, because "X" looks ambiguous with "off" or "no".
image

The ASCII theme looks unchanged but now uses the theme system, as it currently stands, as intended.

If the border edge parts now look a bit weird in combination with the inner boxes then perhaps in future border glyphs can be added to allow customizing those as well. Perhaps the theme system will be removed sometime soon and it shall be possible to customize more of the elements using style attributes to alter the individual glyphs as desired, but these are sensible defaults.

@slook
slook force-pushed the theme-checkbox-radiobox branch from 10ce421 to 7ab59de Compare November 8, 2025 00:54
@ceccopierangiolieugenio

Copy link
Copy Markdown
Owner

Thanks,

This thing is something I had in my backlog for ages,
As you pointed I want to get rid of the Themes class and include the glyphs inside the classStyle,

Except for the NerdFonts (used only in the file icons),
I think I will drop the ascii support because I am not actively testing it and because only some rare edge cases (GPM/TTY) actually needs it.

The reason I didn't make this change yet in the checkbox is for laziness and also because I want to get rid of the parenthesis and this would drop the size from 3 to 1 and I am not sure which issues it would cause.

Anyway keeping the parenthesis is something I haven't considered and it doesn't looks bad, it could be a good solution for now.

@slook

slook commented Nov 8, 2025

Copy link
Copy Markdown
Contributor Author

I think I will drop the ascii support ... only some rare edge cases (GPM/TTY) actually needs it.

Then it should be kept at least for that type of fallback scenario. Ideally the terminal driver would automatically detect if there are no unicode support and display the ASCII theme characters instead. The rudimentary aesthetic of it has an intrinsic value so it shouldn't be dropped. Also, since there is only one other theme at the moment, it provides a base for structuring the planned classStyle implementation for the sake of testing support of custom glyphs/themes.

I want to get rid of the parenthesis and this would drop the size from 3 to 1 and I am not sure which issues it would cause

I tried doing this but the unicode boxes look too small when they are on their own. Perhaps some other box art characters would be desirable for a more central alignment than standard brackets, but in any case at least one padding is needed on either side.

@ceccopierangiolieugenio
ceccopierangiolieugenio merged commit a02f62c into ceccopierangiolieugenio:main Nov 8, 2025
11 checks passed
@ceccopierangiolieugenio

ceccopierangiolieugenio commented Nov 8, 2025

Copy link
Copy Markdown
Owner

for some reason it is glitching on my terminal (ghostty)

image

it seems an issue with the font used (Jetbrains Mono)

raised:
JetBrains/JetBrainsMono#740

@slook

slook commented Nov 9, 2025

Copy link
Copy Markdown
Contributor Author

That's quite a popular font I would imagine. What about using just a regular box square like or or instead of , since the outlined square isn't really needed since we're keeping the outer brackets anyway, does that avoid the faulty character fallback?

@ceccopierangiolieugenio

Copy link
Copy Markdown
Owner

I'll wait few weeks, if I notice that no progress, probably we can switch back to the simple block.

@slook

slook commented Nov 9, 2025

Copy link
Copy Markdown
Contributor Author

The simple block might be a better choice anyway, since on terminals without extended unicode support all three of the special checkbox characters are missing which means they all look like diamonds (the placeholder character).

@ceccopierangiolieugenio

Copy link
Copy Markdown
Owner

It seems a fix is on the way with ghostty,
I reported it here:

ghostty-org/ghostty#8822 (comment)

@ceccopierangiolieugenio

Copy link
Copy Markdown
Owner

I will probably roll back to the square in the next release and keep a note to check when the fix will be available

@ceccopierangiolieugenio

ceccopierangiolieugenio commented Nov 9, 2025

Copy link
Copy Markdown
Owner

Just checked the comments and I it seems that the very last release fixed it:

Still it is not perfect but aligned much better.

image

ghostty-org/ghostty#8822 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants