PolyMeilex / sctk-adwaita

Adwaita-like SCTK Frame
MIT License
26 stars 19 forks source link

Support custom header buttons layouts #30

Closed ilya-m32 closed 1 year ago

ilya-m32 commented 1 year ago

Closes https://github.com/PolyMeilex/sctk-adwaita/issues/27

In this MR I've generalized the button structure and it is now possible to have custom layouts in window headers similar to what you can have in Gnome apps or classic Xorg WMs.

Obvious use case for this would be to have buttons moved to the left side (like Unity): Screenshot from 2023-06-02 17-48-45

But other possible layout combinations should work, too: Screenshot from 2023-06-02 17-51-02 or even something crazy like Screenshot from 2023-06-02 17-52-01

Also should be extendable if we will (ever) have an app menu button.

I didn't have any experience in rust so far, thus feedback is more than welcomed.

ilya-m32 commented 1 year ago

found few things to improve during self review, will move to draft for a short moment

ilya-m32 commented 1 year ago

It's ready for checking now!

ilya-m32 commented 1 year ago

@PolyMeilex Thanks for the feedback! I've made changes to the MR, should be good to go

PolyMeilex commented 1 year ago

Ok, looks great now, just one more comment that I noticed, and some more testing and this should be good to go!

orowith2os commented 1 year ago

Might I suggest utilizing Settings from the ashpd crate?

PolyMeilex commented 1 year ago

Sadly ashpd with zbus would probably pull in more dependencies then this whole crate. Which is a big blocker, for small decorations crate. It would probably be better fitted in winit where we could integrate it with event loop, and update settings on the fly rather than once on startup, but I'm not sure if heavy deps like zbus are welcome in winit either (I actually don't know, haven't asked around).

PolyMeilex commented 1 year ago

Thank you!