Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not apply style attributes to empty space #907

Open
johnd0e opened this issue Feb 11, 2025 · 10 comments
Open

Do not apply style attributes to empty space #907

johnd0e opened this issue Feb 11, 2025 · 10 comments

Comments

@johnd0e
Copy link
Contributor

johnd0e commented Feb 11, 2025

Description of the new feature or improvement

Currently Underline, Overline and Strikeout attributes are applied to the whole field (e.g. full editbox width in a dialog, or full column width on the filepanel).
That has little sens and looks ugly.

There should be a possibility to apply style only to the real text.

Proposed technical implementation details (optional)

No response

@alabuzhev
Copy link
Contributor

That has little sens

Applying these attributes to static interface elements doesn't make much sense in the first place.
Why do you need that?
They are mostly for dynamic color overlays, e.g. files highlighting or editor lines.

@HamRusTal
Copy link
Contributor

Files highlighting is exactly where I mostly see the described behavior:

Image

I am not saying I particularly dislike it, but sometimes it is seen in dialogs (where I have hotkeys underlined) and it looks really weird:

Image

@johnd0e
Copy link
Contributor Author

johnd0e commented Feb 11, 2025

Well, text in editbox is not static.
Sample usage: underline it in red, when the entered value is not correct.
But could be useful for static text too, in my opinion.

P.S.
And files highlighting is not OK now. That I'd call ugly.

@alabuzhev
Copy link
Contributor

Ok, supposedly we can say that the highlighted areas are just "fill" and don't have any "foreground", therefore any visible foreground attributes (under/overline and strikethrough) should not apply there:

Image

Is this what you want?

@HamRusTal
Copy link
Contributor

Is this what you want?

Not really. Ideally, these “blank” areas are controlled separately. Or at least each time a user specifies visual attributes like underlining, there's a choice whether to apply the attributes to the respective blank areas.

@alabuzhev
Copy link
Contributor

The thing is, even separating "text" and "blank" is not so trivial.
Currently almost everywhere those things are formatted & aligned first and then printed in one go using the specified color.
To separate, we will need to reimplement all that and output chunks one by one, switching colors in between. It's not impossible, but can be labor-intensive and error-prone.

I don't feel like adding a bunch of new colors or logic on top of that only to control blank areas separately. It might be useful occasionally, but hardly worth the effort.

@HamRusTal
Copy link
Contributor

labor-intensive and error-prone

And likely will affect performance I assume

@alabuzhev
Copy link
Contributor

Technically yes.
But it's about 'printing' to a memory buffer, not to a device, so probably within the margin of error.

@johnd0e
Copy link
Contributor Author

johnd0e commented Feb 12, 2025

Ok, supposedly we can say that the highlighted areas are just "fill" and don't have any "foreground"

I'd say yes, that is exactly what I mean/want.

But when filename contains real spaces - that is different, I suppose that spaces must be under/overlined/strikedout etc.

But I'm not sure about Inverse.

@alabuzhev
Copy link
Contributor

But when filename contains real spaces - that is different, I suppose that spaces must be under/overlined/strikedout etc.

Exactly.

Dropping styles from all spaces would be trivial.
I can add it today and it will only need 10 or so lines of code.
And it would probably be way better than the current situation.
But it would be incorrect and probably annoying in certain corner cases.
But today.
But incorrect.
And the proper solution, as described above, is complex and labor-intensive, so it may require a year. Or 10 years.
But proper.
But 10 years.

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

No branches or pull requests

3 participants