Skip to content
Snippets Groups Projects

Add per panel css customization

Merged Zetta1 Reid0 requested to merge Zetta1_Reid0/xfce4-panel:per-panel-css into master

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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Zetta1 Reid0 added 1 commit

    added 1 commit

    • 432e9d57 - Add per panel css customization

    Compare with previous version

  • 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 for finalize(), so that PanelWindow:id is set when the CSS classes are added.

  • Gaël Bonithon changed milestone to %4.19.4

    changed milestone to %4.19.4

  • mentioned in issue #597 (closed)

    • Author Contributor

      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 access PanelWindow:id via panel_window_get_id() at that point.

      Edited by Gaël Bonithon
    • Just to make sure you've understood me correctly

      Apparently I didn't make myself clear :) I don't know how else to say it though... The panel-window.c file just shouldn't change.

    • Author Contributor

      Ogh , i understood the second message... when I see it 1 min ago. :D Anyway i can revert to master, and redo it this way, if you wan't it.

    • Yes please, simply override constructed() in PanelBaseWindow, and also move the addition of other CSS classes from init() to constructed().

    • Author Contributor

      Ok . 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. And id 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?

    • Author Contributor

      Ok will do that. I agree there. It is just that I am stupid, and didn't think of not needing id to set class.

    • Please register or sign in to reply
  • Zetta1 Reid0 added 3 commits

    added 3 commits

    Compare with previous version

  • Zetta1 Reid0 added 1 commit

    added 1 commit

    • ae8d5d9d - Move panel, id to base window, add per panel css capability

    Compare with previous version

  • Zetta1 Reid0 added 10 commits

    added 10 commits

    Compare with previous version

  • Zetta1 Reid0 marked this merge request as draft

    marked this merge request as draft

  • Zetta1 Reid0 added 1 commit

    added 1 commit

    • ce8b34ac - Implement per window CSS customization

    Compare with previous version

  • Zetta1 Reid0 added 1 commit

    added 1 commit

    • 95bb2013 - Implement per window CSS customization

    Compare with previous version

  • Zetta1 Reid0 marked this merge request as ready

    marked this merge request as ready

  • Zetta1 Reid0 marked this merge request as draft

    marked this merge request as draft

  • Zetta1 Reid0 added 1 commit

    added 1 commit

    • fffc1e3a - Implement per window CSS customization

    Compare with previous version

  • Zetta1 Reid0 marked this merge request as ready

    marked this merge request as ready

  • Gaël Bonithon added 1 commit

    added 1 commit

    • a920b67d - panel: Implement per window CSS customization

    Compare with previous version

  • Gaël Bonithon added 3 commits

    added 3 commits

    Compare with previous version

  • Thanks!

  • Gaël Bonithon enabled an automatic merge when the pipeline for d1b87c14 succeeds

    enabled an automatic merge when the pipeline for d1b87c14 succeeds

  • Gaël Bonithon canceled the automatic merge

    canceled the automatic merge

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading