From ecc5f48dd788ec5edbd94b6ad50b36a4ebf51b3f Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 15 Apr 2019 11:11:00 +0200 Subject: [PATCH] feat: partially hide waybar on toggle --- resources/style.css | 4 ++++ src/bar.cpp | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/resources/style.css b/resources/style.css index 5526d67f..2a6f9bea 100644 --- a/resources/style.css +++ b/resources/style.css @@ -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; diff --git a/src/bar.cpp b/src/bar.cpp index d042b24e..c704bd1c 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -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); }