soreau / pixdecor

Pixdecor plugin
MIT License
17 stars 3 forks source link

Request: User selectable button colors #26

Open f-l-y-b-o-y opened 1 month ago

f-l-y-b-o-y commented 1 month ago

With the default (black) color and dark theme buttons are almost invisible. I modified deco-theme.cpp line 210 to draw the the lines in white and looks great for now, almost matching my GTK Adwaita-Dark. It would be awesome for users to be able to assign the color in wayfire.ini (other useful options: width of a stroke and space between icons).

241022_03-49-38

soreau commented 1 month ago

Here's a WIP patch. If it works, we might be able to consider some variant of it. The main thing that could use attention is the line width of the minimize and maximize buttons don't always match the close button, apparently because close uses diagonal lines while the others use straight ones.

soreau commented 1 month ago

This patch adds the three options you requested. Apply it with curl https://termbin.com/d9lf | git apply from the pixdecor source directory.

f-l-y-b-o-y commented 1 month ago

Oh man that was quick! I just tried to apply that patch, but I'm getting an error (see screenshot). I deleted and cloned the git again and tried on a fresh one with the same result... 241023_02-50-03

soreau commented 1 month ago

This is because I made the patch against the track-wlroots-0.18 branch. You would have to apply it manually for the master branch.

f-l-y-b-o-y commented 1 month ago

Got it. Compiled just fine and works very well! Thank you. Btw I see what you mean with the width of the close button, small detail, I can live with that.

Also I think this should be the default window decoration plugin for Wayfire!

241023_12-11-34

f-l-y-b-o-y commented 1 month ago

I've found an issue with that patch, and it's not visual but in performance. There's a significant lag and "choppiness " while resizing windows. The master branch build is perfectly smooth when resizing windows.

soreau commented 1 month ago

Thanks for the report. I think it's due to the added resize() call which is a bit of a hack to get the buttons to refresh immediately when options are changed.

soreau commented 1 month ago

I've found an issue with that patch, and it's not visual but in performance. There's a significant lag and "choppiness " while resizing windows. The master branch build is perfectly smooth when resizing windows.

This version should fix that particular issue.

This wayfire pull request might interest you as well.

f-l-y-b-o-y commented 1 month ago

Can confirm the latest patch fixed that resizing lag. It is as smooth as the master branch. Thanks again!

soreau commented 1 month ago

Maybe the disconnect between the button line widths isn't such a sin, I'll consider adding the patch. I almost think we should render the buttons with GL directly instead of cairo, but this would require further developments.