2018-08-29 20:36:39 +02:00
|
|
|
#include "modules/sni/tray.hpp"
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
waybar::modules::SNI::Tray::Tray(const Json::Value& config)
|
2018-09-04 23:50:08 +02:00
|
|
|
: config_(config), watcher_(), host_(&dp)
|
2018-08-29 20:36:39 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
auto waybar::modules::SNI::Tray::update() -> void
|
|
|
|
{
|
2018-09-04 23:50:08 +02:00
|
|
|
for (auto& item : host_.items) {
|
|
|
|
item.event_box.set_tooltip_text(item.title);
|
|
|
|
box_.pack_start(item.event_box);
|
2018-08-29 20:36:39 +02:00
|
|
|
}
|
|
|
|
if (box_.get_children().size() > 0) {
|
|
|
|
box_.set_name("tray");
|
|
|
|
box_.show_all();
|
|
|
|
} else {
|
|
|
|
box_.set_name("");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
waybar::modules::SNI::Tray::operator Gtk::Widget &() {
|
|
|
|
return box_;
|
|
|
|
}
|