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

Add a titlebar #255

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add a titlebar #255

wants to merge 5 commits into from

Conversation

mendelmaleh
Copy link

I wanted mako to match the sway window aesthetics, so I added a titlebar. To enable it title-format needs to be set in the config.
It will only render if that option is set and there is text to show, otherwise the notification will look like it used to before this.

@mendelmaleh
Copy link
Author

Force pushed because I fixed a bug in the first commit and rebased.

@mendelmaleh mendelmaleh force-pushed the titlebar branch 2 times, most recently from 817adbe to e0d6563 Compare April 7, 2020 05:14
@emersion
Copy link
Owner

Thanks for the patch! I'm wondering if this feature is worth the added complexity...

@mendelmaleh
Copy link
Author

mendelmaleh commented Apr 14, 2020

Fixed up some quirks with border radius. I'm not aware of any other bugs, after using this for around a week and testing a bit. I do think this is worth it, it fits really well with sway, imo.

@emersion
Copy link
Owner

Would there be a nice way to de-duplicate some of the rendering logic? format and title_format are pretty similar.

@mendelmaleh
Copy link
Author

I will try, but I'm very much a beginner at C. For the most part I avoided touching what I didn't need to xD

@mendelmaleh
Copy link
Author

Another edge case done, I will try now deduplicating the config.c.

@mendelmaleh
Copy link
Author

@emersion does this last commit look any good? It compiles and runs fine, but I really don't know much about styling, naming, etc.
I didn't see a code style for the repo, so if there is a more general one I should be aware of do tell me, all resources are appreciated.

This will add support for three new keys:
    - title-format
    - title-padding
    - title-color

These are stored respectively:
    - style->title_format
    - style->title_padding
    - style->colors.title
This adds a titlebar to individual notifications. It will only render if
titlebar-format is set in the config, and if there is text to render in
it. Otherwise, the notification will render the same as it used to
before this.
This way when border radius is enabled, the bottom (outside) corners of
the titlebar will be filled with the progress bar.
@ammgws
Copy link
Contributor

ammgws commented Jun 23, 2020

@mendelmaleh Perhaps this will help regarding the styling: https://github.com/swaywm/sway/blob/master/CONTRIBUTING.md

@emersion
Copy link
Owner

emersion commented Sep 7, 2020

I'm on the fence wrt. this PR: I'm not sure we should add this extra functionality. I don't want to maintain software with too many features, and this opens the door to other UI elements like footer/sidebars/etc.

@vilhalmer
Copy link
Collaborator

I wonder, would it be sufficient to instead allow specifying a gradient with multiple stops that get passed straight to cairo? That would avoid adding (much) extra work on the mako side, and you can create a hard edge that appears to be a title bar if you wish.

@markstos
Copy link
Contributor

I think this is unnecessary. Now the PR has been open almost two years and there's been little interest in it.

@NiciTheNici
Copy link

I feel like this merge request can be closed after 2 years of no activity as well. @emersion

@noahhefner
Copy link

Probably safe to close this now?

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.

None yet

7 participants