amnweb / yasb

A highly configurable cross-platform (Windows) status bar written in Python.
Other
114 stars 13 forks source link

Default background behind the bar. #2

Open FlyinCow opened 2 months ago

FlyinCow commented 2 months ago

I'm trying to make a nice rounded-corner bar while I find there's a default background. It only appears with blur effect on. style.css:

.bar {
  background-color: rgba(255, 255, 255, 1); // only to make it more clear
  padding: 0 8px;
  border-radius: 8px;
}

With bars.blur_effect.enabled=true and bars.blur_effect.arcylic=true in config.yaml: image

With bars.blur_effect.enabled=true butbars.blur_effect.arcylic=false: image

With bar.blur_effect.enabled=false it will disappear: image

There may be something to do with PyQT itself. Rather removing this background or making a bar.border option with will be generous.

BTW is this bar just a PyQT window at all? Maybe I will learn to fix it myself.

FlyinCow commented 2 months ago

Meanwhile I find that backdrop-filter and filter won't work in style.css, so I have to rely on bars.blur_effect.

amnweb commented 2 months ago

Yeah, I know about this. This is something which I will try to fix in the next few days. It's not just bar but same problem on power menu popup when blur is enabled. If you find how to make it please open PR.

eivl commented 2 months ago

I have been looking into the details about this issue @FlyinCow; it does not look like you can make the blurred background translucent. The Windows API on this topic is a bit unclear to me, so I might not be correct, so think of this as a good, educated guess.

Pre windows 8.1 I have found solutions that could work, I however dont use ancient windows versions, and I dont think having mixed support of features is a good way either.

There are ways to work around this issue. That is, to create two separate bars of different sizes and use the second as a border to hide the square corners.

image image

But this requires a significant rewrite of the original forked code. This is something I can do if we as a community want that. We could also talk to the original authors and contributors to see if they have some insights.

amnweb commented 1 week ago

This should be fixed in the dev branch now, we are moving to the proper Windows API, so now the radius is controlled by the OS. Unfortunately, the Windows API does not allow setting a custom radius.

image

image