Alexays / Waybar

Highly customizable Wayland bar for Sway and Wlroots based compositors. :v: :tada:
MIT License
6.42k stars 696 forks source link

Tray module spacing option breaks hover when in group drawer. #2906

Open JacksonBrienen opened 7 months ago

JacksonBrienen commented 7 months ago

Currently I am using tray within a group's drawer, when spacing is set within the tray module if I hover between the gap of the first and second tray icon the drawer collapses. Relevant Config:

"custom/expand": {
    "tooltip": false,
    "format": "\uf0d9"
},

"tray": {
    "spacing": 8
},

"group/minimized": {
    "orientation": "horizontal",
    "modules": ["custom/expand", "tray"],
    "drawer": {
        "transition-duration": 500,
        "children-class": "minimized"
    }
}

Relevant Styling:

#custom-expand {
    min-width: 25px;
}

#tray {
    margin: 0;
    padding: 0;
    margin-left: 3px;
}

#group-minimized {
    border-left: solid;
    border-left-width: 0.5;
}

Demo: waybar-tray-demo

I have tried a lot in fixing this, including referencing Issue #2569, which uses menu and menuitem tags in the css selector, but I have so far failed to get either of these to work. My solution is not very clean, but gets the job done, I use the #tray * selector and set a left margin, note that #tray > * > * also works and is technically more "specific" in terms of selection. Working Config:

"custom/expand": {
    "tooltip": false,
    "format": "\uf0d9"
},

"tray": {},

"group/minimized": {
    "orientation": "horizontal",
    "modules": ["custom/expand", "tray"],
    "drawer": {
        "transition-duration": 500,
        "children-class": "minimized"
    }
}

Working Styling:

#custom-expand {
    min-width: 25px;
}

#tray {
    margin: 0;
    padding: 0;
}

#tray * {
    margin-left: 8px;
}

#group-minimized {
    border-left: solid;
    border-left-width: 0.5;
}

It is important to note that I have not been able to get this selector to work with the hover pseudo class. Working Demo: waybar-tray-working-demo

Running waybar version 0.9.24 on Arch Linux with Hyprland.

maydayv7 commented 7 months ago

+1, occurs with latest master

DanteDragan commented 5 months ago

Same situation.