Converting string to button code rn as to avoid doing it later
| 467 | |
| 468 | // Converting string to button code rn as to avoid doing it later |
| 469 | void waybar::Bar::setupAltFormatKeyForModule(const std::string& module_name) { |
| 470 | if (config.isMember(module_name)) { |
| 471 | Json::Value& module = config[module_name]; |
| 472 | if (module.isMember("format-alt")) { |
| 473 | if (module.isMember("format-alt-click")) { |
| 474 | Json::Value& click = module["format-alt-click"]; |
| 475 | if (click.isString()) { |
| 476 | if (click == "click-right") { |
| 477 | module["format-alt-click"] = 3U; |
| 478 | } else if (click == "click-middle") { |
| 479 | module["format-alt-click"] = 2U; |
| 480 | } else if (click == "click-backward") { |
| 481 | module["format-alt-click"] = 8U; |
| 482 | } else if (click == "click-forward") { |
| 483 | module["format-alt-click"] = 9U; |
| 484 | } else { |
| 485 | module["format-alt-click"] = 1U; // default click-left |
| 486 | } |
| 487 | } else { |
| 488 | module["format-alt-click"] = 1U; |
| 489 | } |
| 490 | } else { |
| 491 | module["format-alt-click"] = 1U; |
| 492 | } |
| 493 | } |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | void waybar::Bar::setupAltFormatKeyForModuleList(const char* module_list_name) { |
| 498 | if (config.isMember(module_list_name)) { |
nothing calls this directly
no outgoing calls
no test coverage detected