Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support custom header buttons layouts #30

Merged
merged 3 commits into from
Jul 1, 2023

Conversation

ilya-m32
Copy link
Contributor

@ilya-m32 ilya-m32 commented Jun 2, 2023

Closes #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
Copy link
Contributor Author

ilya-m32 commented Jun 3, 2023

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

@ilya-m32 ilya-m32 changed the title Support custom header buttons layouts Draft: Support custom header buttons layouts Jun 3, 2023
@ilya-m32 ilya-m32 marked this pull request as draft June 3, 2023 16:12
@ilya-m32 ilya-m32 force-pushed the feature/left-sided-buttons branch from ddafd1b to f4d276d Compare June 4, 2023 12:29
@ilya-m32 ilya-m32 force-pushed the feature/left-sided-buttons branch from f4d276d to 0df296c Compare June 4, 2023 12:34
@ilya-m32 ilya-m32 changed the title Draft: Support custom header buttons layouts Support custom header buttons layouts Jun 4, 2023
@ilya-m32 ilya-m32 marked this pull request as ready for review June 4, 2023 12:34
@ilya-m32
Copy link
Contributor Author

ilya-m32 commented Jun 4, 2023

It's ready for checking now!

Copy link
Owner

@PolyMeilex PolyMeilex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks awesome!
Just some minor comments about stylistic stuff.

src/buttons.rs Outdated Show resolved Hide resolved
src/buttons.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
src/config.rs Outdated Show resolved Hide resolved
src/buttons.rs Outdated Show resolved Hide resolved
src/buttons.rs Outdated Show resolved Hide resolved
src/buttons.rs Outdated Show resolved Hide resolved
src/buttons.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@ilya-m32
Copy link
Contributor Author

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

src/config.rs Outdated Show resolved Hide resolved
@PolyMeilex
Copy link
Owner

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

Co-authored-by: Bartłomiej Maryńczak <[email protected]>
@orowith2os
Copy link

Might I suggest utilizing Settings from the ashpd crate?

@PolyMeilex
Copy link
Owner

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 PolyMeilex merged commit 68035e5 into PolyMeilex:master Jul 1, 2023
@PolyMeilex
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configurable title bar buttons layout
3 participants