fea(workspaces): add disable-scroll config

This commit is contained in:
Alexis 2018-08-16 17:12:45 +02:00
parent e4f35d7ca0
commit 8768183f3d
2 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,7 @@
"modules-right": ["pulseaudio", "network", "cpu", "memory", "battery", "clock"],
// Modules configuration
"sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "format-icons": {
// "1": "",

View File

@ -105,8 +105,10 @@ void waybar::modules::sway::Workspaces::addWorkspace(Json::Value node)
}
});
button.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);
button.signal_scroll_event()
.connect(sigc::mem_fun(*this, &Workspaces::handleScroll));
if (!config_["disable-scroll"].asBool()) {
button.signal_scroll_event()
.connect(sigc::mem_fun(*this, &Workspaces::handleScroll));
}
box_.reorder_child(button, node["num"].asInt());
if (node["focused"].asBool()) {
button.get_style_context()->add_class("focused");