waybar/include/modules/sni/tray.hpp

30 lines
645 B
C++
Raw Normal View History

#pragma once
#include <fmt/format.h>
2018-11-22 16:20:49 +01:00
#include "bar.hpp"
#include "util/json.hpp"
#include "IModule.hpp"
2018-11-22 15:47:23 +01:00
#include "modules/sni/watcher.hpp"
#include "modules/sni/host.hpp"
namespace waybar::modules::SNI {
class Tray : public IModule {
public:
Tray(const std::string&, const Bar&, const Json::Value&);
2018-12-26 11:13:36 +01:00
~Tray() = default;
auto update() -> void;
operator Gtk::Widget &();
private:
2018-11-22 15:47:23 +01:00
void onAdd(std::unique_ptr<Item>& item);
void onRemove(std::unique_ptr<Item>& item);
2018-12-01 00:10:41 +01:00
static inline std::size_t nb_hosts_ = 0;
const Json::Value& config_;
Gtk::Box box_;
SNI::Watcher watcher_ ;
SNI::Host host_;
};
}