mirror of
https://github.com/rad4day/Waybar.git
synced 2023-12-21 10:22:59 +01:00
refactor(modules): const bar
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#include "factory.hpp"
|
||||
|
||||
waybar::Factory::Factory(Bar& bar, const Json::Value& config)
|
||||
waybar::Factory::Factory(const Bar& bar, const Json::Value& config)
|
||||
: bar_(bar), config_(config)
|
||||
{}
|
||||
|
||||
|
@ -2,8 +2,8 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
waybar::modules::SNI::Tray::Tray(Bar& bar, const Json::Value &config)
|
||||
: config_(config), watcher_(), host_(bar.nb_tray_hosts, config,
|
||||
waybar::modules::SNI::Tray::Tray(const Bar& bar, const Json::Value &config)
|
||||
: config_(config), watcher_(), host_(nb_hosts_, config,
|
||||
std::bind(&Tray::onAdd, this, std::placeholders::_1),
|
||||
std::bind(&Tray::onRemove, this, std::placeholders::_1))
|
||||
{
|
||||
@ -11,7 +11,7 @@ waybar::modules::SNI::Tray::Tray(Bar& bar, const Json::Value &config)
|
||||
if (config_["spacing"].isUInt()) {
|
||||
box_.set_spacing(config_["spacing"].asUInt());
|
||||
}
|
||||
bar.nb_tray_hosts += 1;
|
||||
nb_hosts_ += 1;
|
||||
}
|
||||
|
||||
void waybar::modules::SNI::Tray::onAdd(std::unique_ptr<Item>& item)
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "modules/sway/mode.hpp"
|
||||
|
||||
waybar::modules::sway::Mode::Mode(Bar& bar, const Json::Value& config)
|
||||
waybar::modules::sway::Mode::Mode(const Bar& bar, const Json::Value& config)
|
||||
: ALabel(config, "{}"), bar_(bar)
|
||||
{
|
||||
ipc_.connect();
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "modules/sway/window.hpp"
|
||||
|
||||
waybar::modules::sway::Window::Window(Bar &bar, const Json::Value& config)
|
||||
waybar::modules::sway::Window::Window(const Bar &bar, const Json::Value& config)
|
||||
: ALabel(config, "{}"), bar_(bar), windowId_(-1)
|
||||
{
|
||||
label_.set_name("window");
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "modules/sway/workspaces.hpp"
|
||||
|
||||
waybar::modules::sway::Workspaces::Workspaces(Bar& bar,
|
||||
waybar::modules::sway::Workspaces::Workspaces(const Bar& bar,
|
||||
const Json::Value& config)
|
||||
: bar_(bar), config_(config), scrolling_(false)
|
||||
{
|
||||
|
Reference in New Issue
Block a user