fea(workspaces): add disable-scroll config
parent
e4f35d7ca0
commit
8768183f3d
|
@ -9,6 +9,7 @@
|
||||||
"modules-right": ["pulseaudio", "network", "cpu", "memory", "battery", "clock"],
|
"modules-right": ["pulseaudio", "network", "cpu", "memory", "battery", "clock"],
|
||||||
// Modules configuration
|
// Modules configuration
|
||||||
"sway/workspaces": {
|
"sway/workspaces": {
|
||||||
|
// "disable-scroll": true,
|
||||||
// "all-outputs": true,
|
// "all-outputs": true,
|
||||||
// "format-icons": {
|
// "format-icons": {
|
||||||
// "1": "",
|
// "1": "",
|
||||||
|
|
|
@ -105,8 +105,10 @@ void waybar::modules::sway::Workspaces::addWorkspace(Json::Value node)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
button.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);
|
button.add_events(Gdk::SCROLL_MASK | Gdk::SMOOTH_SCROLL_MASK);
|
||||||
|
if (!config_["disable-scroll"].asBool()) {
|
||||||
button.signal_scroll_event()
|
button.signal_scroll_event()
|
||||||
.connect(sigc::mem_fun(*this, &Workspaces::handleScroll));
|
.connect(sigc::mem_fun(*this, &Workspaces::handleScroll));
|
||||||
|
}
|
||||||
box_.reorder_child(button, node["num"].asInt());
|
box_.reorder_child(button, node["num"].asInt());
|
||||||
if (node["focused"].asBool()) {
|
if (node["focused"].asBool()) {
|
||||||
button.get_style_context()->add_class("focused");
|
button.get_style_context()->add_class("focused");
|
||||||
|
|
Loading…
Reference in New Issue