Skip to content

Commit

Permalink
fix: hide tray when there are no non-passive icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Bahnschrift committed Dec 19, 2024
1 parent e959f1d commit 083b919
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/modules/sni/tray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <spdlog/spdlog.h>

#include <algorithm>

namespace waybar::modules::SNI {

Tray::Tray(const std::string& id, const Bar& bar, const Json::Value& config)
Expand Down Expand Up @@ -39,7 +41,9 @@ void Tray::onRemove(std::unique_ptr<Item>& item) {

auto Tray::update() -> void {
// Show tray only when items are available
event_box_.set_visible(!box_.get_children().empty());
auto children = box_.get_children();
event_box_.set_visible(std::any_of(children.begin(), children.end(),
[](auto child) { return child->get_visible(); }));
// Call parent update
AModule::update();
}
Expand Down

0 comments on commit 083b919

Please sign in to comment.