feat: partially hide waybar on toggle

pull/274/head
Alex 2019-04-15 11:11:00 +02:00
parent 316b948d86
commit ecc5f48dd7
2 changed files with 9 additions and 0 deletions

View File

@ -12,6 +12,10 @@ window#waybar {
color: #ffffff;
}
window#waybar.hidded {
opacity: 0.2;
}
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
#workspaces button {
padding: 0 5px;

View File

@ -266,6 +266,11 @@ auto waybar::Bar::toggle() -> void
{
visible = !visible;
auto zone = visible ? height_ : 0;
if (!visible) {
window.get_style_context()->add_class("hidded");
} else {
window.get_style_context()->remove_class("hidded");
}
zwlr_layer_surface_v1_set_exclusive_zone(layer_surface, zone);
wl_surface_commit(surface);
}