refactor: remove useless bar param

This commit is contained in:
Alex 2019-05-07 13:21:18 +02:00
parent 77d9dd06af
commit b75e0bb0d0
3 changed files with 4 additions and 5 deletions

View File

@ -11,7 +11,7 @@ namespace waybar::modules::sway {
class Mode : public ALabel {
public:
Mode(const std::string&, const waybar::Bar&, const Json::Value&);
Mode(const std::string&, const Json::Value&);
~Mode() = default;
auto update() -> void;
@ -19,7 +19,6 @@ class Mode : public ALabel {
void onEvent(const struct Ipc::ipc_response&);
void worker();
const Bar& bar_;
waybar::util::SleeperThread thread_;
Ipc ipc_;
std::string mode_;

View File

@ -12,7 +12,7 @@ waybar::IModule* waybar::Factory::makeModule(const std::string& name) const {
}
#ifdef HAVE_SWAY
if (ref == "sway/mode") {
return new waybar::modules::sway::Mode(id, bar_, config_[name]);
return new waybar::modules::sway::Mode(id, config_[name]);
}
if (ref == "sway/workspaces") {
return new waybar::modules::sway::Workspaces(id, bar_, config_[name]);

View File

@ -2,8 +2,8 @@
namespace waybar::modules::sway {
Mode::Mode(const std::string& id, const Bar& bar, const Json::Value& config)
: ALabel(config, "{}"), bar_(bar) {
Mode::Mode(const std::string& id, const Json::Value& config)
: ALabel(config, "{}") {
label_.set_name("mode");
if (!id.empty()) {
label_.get_style_context()->add_class(id);