eww icon indicating copy to clipboard operation
eww copied to clipboard

[BUG] Button With Rounded Corners Has Transparent Square Box Behind It That Won't Go Away

Open ghost opened this issue 2 years ago • 6 comments

Checklist before submitting an issue

  • [X] I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • [X] I have specifically verified that this bug is not a common user error
  • [X] I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)

Description of the bug

When I round the corners of a button, the button still has a transparent square box behind it that will not go away.

image

Reproducing the issue

Run my linked bar (make sure to use the linked commit). For testing purposes, the powermenu is expanded by default and I've used bright blue and green and made the bar oversized so the issue is easy to see. You'll notice that the NixOS logo has a blue background with rounded corners, yet for some reason also has a transparent square box behind it.

https://gitlab.com/IsaacBrown92/dotfiles/-/tree/532f6135b25e13c25f4ba99dfb75bb50c20e1781/modules/eww/config

Expected behaviour

There should not be a transparent square box behind the blue NixOS logo background.

Additional context

No response

ghost avatar Jan 19 '23 01:01 ghost

@isaacbrown92 kill your compositor and check

siduck avatar Feb 20 '23 11:02 siduck

To my knowledge, this is just the nature of GTK. Styling only changes the appearance of the items, not the actual structure. However, I'm struggling to see where this would be an issue? If it's transparent, it shouldn't be a problem?

ariealerr avatar Mar 09 '23 23:03 ariealerr

Image

I'm having also having this issue. It seems that when you have a rounded box, the corners take the wallpaper color instead of what is there. The stylesheet I use is here, although I have increased the border radius for the purpose of the photo: Stylesheet

KoenDR06 avatar Apr 29 '25 07:04 KoenDR06

Image

I'm having also having this issue. It seems that when you have a rounded box, the corners take the wallpaper color instead of what is there. The stylesheet I use is here, although I have increased the border radius for the purpose of the photo: Stylesheet

Define the background color using RGBA.

That is, instead of using a hex color code like #24273a, define the color like so: rgba(36, 39, 58, 0.99).

The first three numbers are the red, blue, and green values (out of 255). The fourth number is the alpha value. We need to use a high alpha value to enable transparency — for the corners — without making the widget itself appear transparent.


Tech note: Alpha compositing is a digital imaging technique that involves combining visual elements — foreground and background — to achieve the illusion of transparency.

fyasdani avatar May 23 '25 03:05 fyasdani

@fyasdani thanks, this works great!

KoenDR06 avatar May 23 '25 09:05 KoenDR06

@fyasdani Thanks, the solution worked perfectly!

Zirconium419122 avatar Oct 05 '25 06:10 Zirconium419122