-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Allow PanelApplet to be styled using CSS #1457
Comments
mate-panel, its applets, and its menus do in fact support css styling. I added that code myself back in 2015 and my UbuntuStudio_Legacy GTK theme makes extensive use of it. Here's how I theme the panel and it's menus, note that this is only part of my panel theming code but should be enough to explain this:
Since using PanelApplet doesn't work, I applied the .mate-panel-menu-bar style class to the menus due to the fact that it was already used to style the classic menu applet in gnome-panel as .gnome-panel-menu-bar, I don't remember if it was already used in MATE for that applet at that time. Also note that in GTK2, the UbuntuStudio theme was able to apply the panel background theme to some menus popped up from the panel but not to others. The use of this particular style class rather than a new and more descriptive one was later called out as an overuse of that particular style class, but I had done this so that whatever an existing theme applied to the classic menu would also be applied to all the other menus from the panel. Code had to be added to the panel and to several other packages to get consistant results. I could add another style class but cannot remove the existing one without breaking existing themes. |
I'm aware that the MATE panel itself and some applets do support CSS styling, but more specifically I'm interested in applying styling to PanelApplet via CSS. My aim is to be able to change margin, padding & borders of the workspace switcher to allow GTK3 MATE themes to resemble their GTK2 counterparts. If you see in this old Ubuntu screenshot I found on the web, the workspace switcher has margins & a border. Currently, in MATE there is no way to achieve this effect with CSS. Whilst you can apply things like paddings to the panel entirely, if you want to (for example) add additional padding to the workspace switcher it is not possible afaik. Perhaps I'm being overly pedantic, but it would be nice to have. |
For the switcher, again from my theme:
|
Again, applying things like margins to the workspace switcher is not possible within CSS, whether it's by styling wnck-pager or PanelApplet. Currently, it can only be done by editing the properties via GTK3 inspector. wnck-pager seemingly only seems to accept CSS rules for the background colour; PanelApplet won't accept anything. |
Note that some of the code in all of the wncklet applets comes from libwnck and thus
cannot be changed from inside MATE. This in fact is why I was unable to theme the
window menus that pop up when right-clicking on a window list button or on the "menu"
corner of a window managed by marco or compiz.
|
I see. I believe it should be still possible to allow PanelApplet to be styled with CSS; it doesn't seem to be part of the wnck applets. I would try to implement this myself, but I don't really have the time these days, especially since I'd have to learn how MATE's widgets actually work. For someone who is experienced in developing for MATE, I don't think it's a terribly difficult job. Also, thank you for taking the time to deal with this issue! |
Expected behaviour
Styling PanelApplet using CSS should allow things like the margin, padding, border, etc to be changed. For example:
should apply a 1px margin and 1px black border to PanelApplet (which would then allow us to do things like adding borders & margins to the workspace switcher like in the GNOME 2 days).
Actual behaviour
In reality, PanelApplet seems to ignore any CSS rules defined in themes. Manually changing the properties of PanelApplet inside of the GTK3 inspector does work however. I believe all that needs to be done is to allow PanelApplet to recognise CSS rules defined in various themes. I've listed this as a feature request, as I don't think this is a bug per se, but rather a missing feature.
Steps to reproduce the behaviour
Try to style PanelApplet with CSS.
MATE general version
1.28.2
Package version
1.28.2
Linux Distribution
Fedora 40
Link to bugreport of your Distribution (requirement)
N/A since this is a feature request
The text was updated successfully, but these errors were encountered: