neovim-qt icon indicating copy to clipboard operation
neovim-qt copied to clipboard

[Feature Request] Add Background-Only Transparency to GuiWindowOpacity

Open jgehrig opened this issue 3 years ago • 9 comments

Additional Request from Issue #411

Some users want the ability to set background-only transparency. Extend GuiWindowOpacity so text can be made opaque.

I'm not sure how this can be accomplished with Qt... Can QGraphicsEffect be used?

FYI @matheusfillipe

jgehrig avatar Feb 04 '21 02:02 jgehrig

I would love this feature as a shader artist! Any guidance would be appreciated for how to achieve this. I am currently working on building neovim-qt from source to attempt this.

thePHTest avatar Apr 03 '21 21:04 thePHTest

It looks like this can be accomplished with Qt...

Here is a very quick-and-hacky patch: background_only_transparency.txt

image

I'm not sure if the additional complexity is worth it. To me, it looks quite similar to full-window :GuiWindowOpacity.

Maybe someone who want this feature can create a Pull Request with improved code and do the necessary testing on each platforms?

jgehrig avatar May 05 '21 19:05 jgehrig

@jgehrig Oh it is not very similar at all, I think this is the proper way to do background transparency. The text still remains clear to see, if you look on the bottom "[No Name..." the difference is screaming! At least to me that's how transparency should be handled. The other solution you could already do with the compositor of your system anyway. I would appreciate that!

matheusfillipe avatar May 06 '21 01:05 matheusfillipe

Pull Requests welcomed! 😄

I've got enough work on my plate at the moment. This will require some careful testing (time). Hopefully someone who wants this feature can pick up the slack.

If someone doesn't put a PR together, I will try to find some time eventually.

jgehrig avatar May 06 '21 02:05 jgehrig

I recently applied your patch and it's been working fine. image Looks cool with picom blur! image

I don't think I know enough C++ to submit a PR for this though 😅. The only problem I had with this patch was that the entire buffer isn't being updated when I run the :GuiWindowOpacity command, so i have to scroll or :e for it to update:

guiWindowOpacity

I applied the patch on e1fc9d3684cbbdf29716cce212d52022e326b014.

matheusfillipe avatar Jun 13 '21 07:06 matheusfillipe

@matheusfillipe

I don't think I know enough C++ to submit a PR for this though :sweat_smile:.

The best way to learn is by doing! :smile:

Thanks for the bug reports. Tracking known-issues here is helpful for when someone starts the work.

If no one picks this up... I'll try to get to it eventually.

jgehrig avatar Jun 14 '21 18:06 jgehrig

Making all background colors transparent can make a statusline with powerline symols look weird, as powerline symbols are not transparent, but the background of statusline segments are.

An alternative may be to only make one color or some colors transparent. For example, if only background color is made transparent (which also matches the behavior of many terminal emulators), the whole statusline becomes fully opaque, and powerline symbols have the same colors as statusline segments.

zeertzjq avatar Aug 01 '21 08:08 zeertzjq

Hello, what is the status of this at the moment? Would be nice to have

zadirion avatar Oct 21 '23 19:10 zadirion

Hello, what is the status of this at the moment? Would be nice to have

this patch is valid in the latest version.

For me: there was a problem with the window border.

2023-11-08_1455x1337

I think this is a render issue with neovim/cli, but that doesn't explain why this doesn't happen on the left/top. (In the screenshot, I'm using nvim-qt instead of cli)

thin black lines are due to the screenshot, just pay attention to the edge of the window.

oblivcheck avatar Nov 08 '23 10:11 oblivcheck