FedoraQt / QAdwaitaDecorations

Qt decoration plugin implementing Adwaita-like client-side decorations
GNU Lesser General Public License v2.1
72 stars 8 forks source link

Fixed window borders #69

Closed bertini97 closed 3 months ago

bertini97 commented 3 months ago

Currently, the window border routine draws border of 1px and ignores the ceWindowBorderWidth variable (which is indeed set to 1). The border should look wrong, because it shouldn't be drawn in the left part of the window, as the routine doesn't account for it.

To my surprise, however, windows had a border on the left part. After a while I figured it only looks right because the antialiasing makes all 1px lines as 2px. I noticed this while triying to fix the titlebar border being noticeably 2px thick. Here is a comparison with no shadow and a highlighted border:

Schermata del 2024-06-04 18-10-55

Notice how the titlebar border "leaks" onto the window border for a few pixels, and how all the borders except the title bar are transparent. Also the titlebar separator cuts the window border. Here is the window with my patch, removing antialiasing and accounting for a window border.

Schermata del 2024-06-04 18-13-38

The borders aren't transparent anymore, the titlebar border is the same thickness as the rest, and the title bar stops where it should. One thing that is missing is the fact that the border is 1px regardless of the ceWindowBorderSize because the pen is not set.

grulja commented 3 months ago

Hi, thank you for this change.

I've tried to play with this a bit. I don't think we should disable antialising as seen on your second image, you can see the rounded corners are not looking good. Here is an alternative fix for this https://github.com/FedoraQt/QAdwaitaDecorations/pull/70. Can you please look into it? I think it's more understandable. I also removed the separator part completely, because it's already painted and it made it to be painted twice.

bertini97 commented 3 months ago

Indeed the rounded corners aren't great. But this is exacerbated by a dark border tone and a dark shadow (darker than GTK's). To me, having antialiasing for a border isn't the way to go in general, but especially here since in Qt it makes 1px lines semitransparent and 2px wide.

If you feel like keeping it, go for it and feel free to close this PR. It's a cosmetic thing after all :)

BTW, all these problems are very noticeable to me, but maybe you're using an HDPI screen?

grulja commented 3 months ago

Can this be closed now?