feat(Tray): handle item unregister

This commit is contained in:
Alexis
2018-09-04 23:50:08 +02:00
parent fc6e42d748
commit 20ff2cab9e
12 changed files with 127 additions and 107 deletions

View File

@ -3,15 +3,15 @@
#include <iostream>
waybar::modules::SNI::Tray::Tray(const Json::Value& config)
: config_(config), watcher_(), host_(dp)
: config_(config), watcher_(), host_(&dp)
{
}
auto waybar::modules::SNI::Tray::update() -> void
{
for (auto item : host_.items) {
item.image->set_tooltip_text(item.title);
box_.pack_start(*item.image);
for (auto& item : host_.items) {
item.event_box.set_tooltip_text(item.title);
box_.pack_start(item.event_box);
}
if (box_.get_children().size() > 0) {
box_.set_name("tray");