mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor: AModule
This commit is contained in:
@ -4,15 +4,16 @@
|
||||
namespace waybar::modules::SNI {
|
||||
|
||||
Tray::Tray(const std::string& id, const Bar& bar, const Json::Value& config)
|
||||
: config_(config),
|
||||
: AModule(config, "tray", id),
|
||||
box_(bar.vertical ? Gtk::ORIENTATION_VERTICAL : Gtk::ORIENTATION_HORIZONTAL, 0),
|
||||
watcher_(nb_hosts_),
|
||||
host_(nb_hosts_, config, std::bind(&Tray::onAdd, this, std::placeholders::_1),
|
||||
std::bind(&Tray::onRemove, this, std::placeholders::_1)) {
|
||||
box_.set_name("tray");
|
||||
spdlog::warn(
|
||||
"For a functionnal tray you must have libappindicator-* installed and export "
|
||||
"XDG_CURRENT_DESKTOP=Unity");
|
||||
box_.set_name("tray");
|
||||
event_box_.add(box_);
|
||||
if (!id.empty()) {
|
||||
box_.get_style_context()->add_class(id);
|
||||
}
|
||||
@ -41,6 +42,4 @@ auto Tray::update() -> void {
|
||||
}
|
||||
}
|
||||
|
||||
Tray::operator Gtk::Widget&() { return box_; }
|
||||
|
||||
} // namespace waybar::modules::SNI
|
||||
|
Reference in New Issue
Block a user