Add per panel css customization
Releated to #597 (closed) . Basically we want to theme every panel separately.
Solution is to add css class with panel id as a css selector.
But to have a number as css selector is not a good idea, so we prepend it with "panel" string. so we can select specific panels with
.xfce4-panel.panel-[id]
{
}
ofcourse we don't remove the base "panel" css class for compatability reasons.
Merge request reports
Activity
Ok let's do that, and I guess that might be enough to satisfy #597 (closed). On the other hand, I think it would be better to put this in PanelBaseWindow, which is more or less devoted to appearance-related things, and where the other CSS classes have already been added.
You'd have to override GObject's
constructed()
method as is done forfinalize()
, so thatPanelWindow:id
is set when the CSS classes are added.changed milestone to %4.19.4
mentioned in issue #597 (closed)
I thought the same thing . Putting it in panel base window, that way we can seperatly theme the HiddenPanelWindow, but I stopped myself since I have to to move ID implementation in panel base window and idk how that would affect settings and etc. prob not in any away since panel window inherits from PanelBaseWindow. Will work on that.
Just to make sure you've understood me correctly (and to save you unnecessary modifications): you don't need to move the ID implementation from PanelWindow to PanelBaseWindow, just override
constructed()
in PanelBaseWindow and you'll be able to accessPanelWindow:id
viapanel_window_get_id()
at that point.Edited by Gaël BonithonOk . So there is a downside to keeping id of panel in PanelWindow. Hidden Windows can't be styled individually. Does , if you have 2 panels, 1 red and 1 green, and you want to red hidden window to be red and green hidden window to be green you can't, couse basically panel base window does not have an id. But if base panel window implements the id, which I think it should be done from beginning seems more logical that base of all panel window should have the id, we can just sync PanelWindow and HiddenPanelWindow id. so if it is a hidden window we can just append "hidden" to the panel-[id] class, so we can sync changes between them with
.panel-1,
.panel-1-hidden
{
}
it is useful for example in the case you want hidden panels on 1 side of the screen to have visible window since that is your main workarea and user should know that there is panel there, and on the others to not have visible hidden window.
just like they do it on some android ui with gesture controls enabled;
Hmm yes, of course, and now I'm thinking that my idea of putting it in PanelBaseWindow might not be such a good one. The fact that PanelBaseWindow has to wonder if it's implemented by a subclass in
constructed()
doesn't appeal to me. Andid
is a natural property of PanelWindow, not PanelBaseWindow.Actually, I think your first version was better, sorry. Just add the CSS class that depends on the id where it makes sense. Generic CSS classes in PanelBaseWindow, specialized CSS classes in its implementations. And similarly add the
panel-id-hidden
class when instantiating PanelBaseWindow for autohide.Is this right for you?
added 3 commits
-
432e9d57...8a2beeed - 2 commits from branch
xfce:master
- 8e36b66c - Merge branch xfce4-panel:master into per-panel-css
-
432e9d57...8a2beeed - 2 commits from branch
added 1 commit
- ae8d5d9d - Move panel, id to base window, add per panel css capability
added 10 commits
-
ae8d5d9d...cbc1f9fe - 9 commits from branch
xfce:master
- 18eb3161 - Merge branch xfce4-panel:master into per-panel-css
-
ae8d5d9d...cbc1f9fe - 9 commits from branch
added 1 commit
- a920b67d - panel: Implement per window CSS customization
added 3 commits
-
a920b67d...a5cc97fe - 2 commits from branch
xfce:master
- d1b87c14 - panel: Implement per window CSS customization
-
a920b67d...a5cc97fe - 2 commits from branch
enabled an automatic merge when the pipeline for d1b87c14 succeeds