-
Notifications
You must be signed in to change notification settings - Fork 20
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
Should not the background color of inline completions be transparent? #241
Comments
Can you please make a screen shot or video? |
It doesn't set any background colour at all: https://github.com/mike-fabian/ibus-typing-booster/blob/main/engine/hunspell_table.py#L2239
|
Thanks, Mike. Would it be worthy to have the possibility of the user being able to select the background color? |
I'm not sure. Maybe it would be nicer to find out where this background colour comes from and how to avoid it. Of course I could add an option to set the background. But if one sets it to black, it would look good on the dark theme in firefox but would look bad in other places. For the foreground of the inline completion, it is possible to select some colour like a medium gray which looks fine both on white and black backgrounds. I use some sort of orange which also looks fine both on white and black backgrounds. But if one sets the background of the preedit to black, it will only look good on a black background and look terrible everywhere else. I would prefer to leave the background alone. And it looks like I am not setting it at all, so where does this come from 🤔 ? |
And, as you noticed, this doesn't happen in dark themes in gedit. What is different in dark themes in firefox and thunderbird? |
What I mean is to have the user to select the background color from a pallet of colors, Mike! |
Yes, of course, just like you currently choose the foreground colour for the inline completion. But I don't think is possible to choose any colour for the background which looks good on all kinds of themes. For the dark mode in firefox and thunderbird, choosing some very dark gray or black might look OK. But that would look terrible in a light theme. |
So if I would choose a background colour which looks good in Duolingo, it would look bad when writing the github comments. I think what we actually want is to leave the background as it is. |
Maybe, Mike, if we do not explicitly select a transparent background, Thunderbird and Firefox dark theme will choose the background color that is selected by default. |
I immediately tried to explicitely set a transparent background yesterday, but it didn’t help. |
Here is why it didn’t help when I tried this yesterday: in https://github.com/ibus/ibus/blob/master/client/gtk2/ibusimcontext.c#L2037
This seems to handle only red, green, and blue, apparently it ignores the alpha channel for transparency. |
So at the moment I cannot set the alpha value (i.e. the transparency) from ibus-typing-booster, it is ignored in ibus. https://github.com/ibus/ibus/blob/master/client/gtk2/ibusimcontext.c#L2037 would need to be extended to use also |
Testing that the transparency is ignored: From the command line, one can set a foreground colour for the inline completion with transparency like this:
where 0.3 is the transparency value. After doing that one can see in the setup tool that a transparent colour is set: But when testing this by using inline completion with ibus-typing-booster, one finds that there is not transparency, it is 100% opaque. |
In https://github.com/mike-fabian/ibus-typing-booster/blob/main/engine/itb_util.py#L2525 ibus-typing-booster converts the value For example:
I.e. it puts the transparency, 0.5 in this example into the first 8 bit of the 32 bit integer, the 0.5 becomes 7f here. But then the code in https://github.com/ibus/ibus/blob/master/client/gtk2/ibusimcontext.c#L2037 Uses only the lower 24 bits and not the high 8 bits for the transparency. |
It might be interesting to enhance ibus to allow to use transparency in the colours. Might be a useful improvement. But I am not sure whether this would fix the problem seen in the dark theme of firefox/thunderbird. It might fix it, but it is also possible that it would not fix it. Maybe there is a way to fix this in the dark theme? |
To me it also looks like a bug in the dark theme that it uses white as a background colour even though no background colour was set by pango. |
There this option in dark them, Mike, which seems to be set as never by default: Override the colors specified... Maybe if one sets always, it will work. |
I don't see such an option in the extensions I tried. I tried:
|
Does playing with that option help? |
No, Mike. |
Maybe we should leave this problem as it is, as there is nothing more we can do, Mike. |
Yes, I think I can do nothing in ibus-typing-booster at the moment. If I can convince the ibus-developer to support setting transparency, then I could try to use that, maybe it helps. But it is hard to say. And maybe transparency for the ibus colour settings is usually not important. |
Thanks, Mike. Indeed, with no color set for inline completion, it looks better in Thunderbird Dark theme. Hoping that, in the future, the ibus-developer will add transparency! |
I found other stuff which looks pretty bad in the dark theme in thunderbird. When I try to discard a mail I get this dialog: The text on the buttons is not really readable in the dark theme. Looks like the dark theme has some bugs, especially because the dark themes in gedit work well with typing-booster, I suspect there is something wrong with the dark themes in thunderbird and firefox. Maybe one could try to make a bug report against these themes. |
Do you think you can open an issue against the dark thunderbird theme? |
Fujiwara San, the ibus developer, thinks there is no reason to have transparency in the preedit colors. I cannot see a reason either, except to workaround such bugs as in the dark themes for thunderbird and firefox. And then it is probably better to try to fix these bugs in the themes. |
I reported this bug against the dark theme in thunderbird: https://bugzilla.mozilla.org/show_bug.cgi?id=1730678 I am not sure whether this is related to the white background we see in the ibus preedit, but it could be. |
Thanks, Mike! This afternoon, I was going to report the bug against the dark theme in thunderbird, since I was the whole morning in meetings. |
Hi, Mike,
I have recently changed the theme of my Thunderbird to Dark. The ibus-typing-booster inline completion background color does not match the dark one of the compose window -- it is white. Surprisingly, it works fine with the Gedit dark mode -- the background color of inline completions matches the Gedit background color.
My suspicion is that ibus-typing-booster is using white as background color for inline suggestions and not a transparent background color!
Thanks!
The text was updated successfully, but these errors were encountered: