Waybar/src/modules/sni/tray.cpp

22 lines
540 B
C++
Raw Normal View History

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