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 {panel,dock}/css_path and custom CSS support #77

Merged
merged 1 commit into from
Jan 12, 2021

Conversation

diamondburned
Copy link
Contributor

This pull request adds panel/css_path and dock/css_path into the configuration file schema, allowing for custom CSS loading of both the panel and the dock.

[panel]
css_path = /path/to.css

[dock]
css_path = /path/to.css

I think the code to load those CSS could've been better placed elsewhere, but I really can't be bothered to set up my editor environment again, so I would kindly ask you the maintainers to do that, as you know the project more than I do.

@soreau
Copy link
Member

soreau commented Dec 23, 2020

You are the first one I know of that has expressed a desire to adjust the theme separately from the global gtk scheme. What's wrong with styling the way you'd typically style any other gtk application?

@diamondburned
Copy link
Contributor Author

diamondburned commented Dec 23, 2020

What's wrong with styling the way you'd typically style any other gtk application?

I just don't want my bar's button styles to look like a regular application's. It just doesn't look right. Also, having custom CSS lets me toy with some weird styles that I wouldn't otherwise want in a regular application.

On a tangent, the headerbar background color doesn't actually look right to me precisely because I theme other applications like that, and I really want to experiment with background-image, so that's another reason.

Edit: This isn't the first time I've seen custom CSS loading; wofi and rootbar both allow me to do this, and the Gtk applications that I wrote (gtkcord3 and catnip-gtk) all allow me to do this as well.

@ammen99
Copy link
Member

ammen99 commented Dec 23, 2020

@diamondburned Have you thought about simply applying a custom theme via GTK_THEME?

@soreau
Copy link
Member

soreau commented Dec 23, 2020

@ammen99 Recently I inquired about GTK_THEME in #gtk and one of the developers indicated that GTK_THEME is for testing and meant not to work.

@ammen99
Copy link
Member

ammen99 commented Dec 23, 2020

@ammen99 Recently I inquired about GTK_THEME in #gtk and one of the developers indicated that GTK_THEME is for testing and meant not to work.

Ah, I see. I'll review this PR soon then, it would make sense to have it.

@diamondburned
Copy link
Contributor Author

In hindsight, using the USER priority for the CSS provider isn't the best idea, as it made it harder to test CSS using GTK_DEBUG=interactive, since the debugger's priority is lower.

@soreau
Copy link
Member

soreau commented Dec 24, 2020

@diamondburned There are other priorities, you can find the gtk3 list here, though I'm not sure if there is one that will do what you want. Did you still want someone else to pick this up and submit a new PR? It looks like I might have to do the same for wf-menu.

@diamondburned
Copy link
Contributor Author

@diamondburned There are other priorities, you can find the gtk3 list here, though I'm not sure if there is one that will do what you want. Did you still want someone else to pick this up and submit a new PR? It looks like I might have to do the same for wf-menu.

I think USER is fine; it's just a minor inconvenience, and USER is technically correct (though APPLICATION isn't so bad either).

Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

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

LGTM overall, please fix code style.

src/dock/dock.cpp Outdated Show resolved Hide resolved
Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@ammen99 ammen99 merged commit 59a8f0d into WayfireWM:master Jan 12, 2021
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.

3 participants