diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-05-08 15:31:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-08 15:31:02 +0100 |
| commit | b94f1498542be0e83fe8060a50bce5ff2d5a1c39 (patch) | |
| tree | 8bddcfc9f8504817d5778136ec8c7c05d881c852 /src/config/shared/actions/ConfigActions.cpp | |
| parent | a6a0cc308c827557d04cb3e4c3b5d258de0411e6 (diff) | |
config: allow hashes for parsing colors (#14337)
Diffstat (limited to 'src/config/shared/actions/ConfigActions.cpp')
| -rw-r--r-- | src/config/shared/actions/ConfigActions.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/config/shared/actions/ConfigActions.cpp b/src/config/shared/actions/ConfigActions.cpp index 3f586b9f..a59b4ab3 100644 --- a/src/config/shared/actions/ConfigActions.cpp +++ b/src/config/shared/actions/ConfigActions.cpp @@ -1,4 +1,5 @@ #include "ConfigActions.hpp" +#include "../parserUtils/ParserUtils.hpp" #include "../../../desktop/state/FocusState.hpp" #include "../../../desktop/view/Window.hpp" #include "../../../desktop/view/Group.hpp" @@ -726,15 +727,15 @@ ActionResult Actions::setProp(const std::string& PROP, const std::string& VAL, s if (TOKEN.ends_with("deg")) colorData.m_angle = std::stoi(std::string(TOKEN.substr(0, TOKEN.size() - 3))) * (PI / 180.0); else - configStringToInt(std::string(TOKEN)).and_then([&colorData](const auto& e) { + ParserUtils::parseColor(std::string(TOKEN)).and_then([&colorData](const auto& e) { colorData.m_colors.push_back(e); - return std::invoke_result_t<decltype(::configStringToInt), const std::string&>(1); + return std::invoke_result_t<decltype(ParserUtils::parseColor), const std::string&>(1); }); } } else if (VAL != "-1") - configStringToInt(VAL).and_then([&colorData](const auto& e) { + ParserUtils::parseColor(VAL).and_then([&colorData](const auto& e) { colorData.m_colors.push_back(e); - return std::invoke_result_t<decltype(::configStringToInt), const std::string&>(1); + return std::invoke_result_t<decltype(ParserUtils::parseColor), const std::string&>(1); }); colorData.updateColorsOk(); @@ -754,15 +755,15 @@ ActionResult Actions::setProp(const std::string& PROP, const std::string& VAL, s Desktop::Types::SAlphaValue{std::stof(VAL), PWINDOW->m_ruleApplicator->alphaFullscreen().valueOrDefault().overridden}, Desktop::Types::PRIORITY_SET_PROP)); } else if (PROP == "opacity_override") { PWINDOW->m_ruleApplicator->alphaOverride(Desktop::Types::COverridableVar( - Desktop::Types::SAlphaValue{PWINDOW->m_ruleApplicator->alpha().valueOrDefault().alpha, sc<bool>(configStringToInt(VAL).value_or(0))}, + Desktop::Types::SAlphaValue{PWINDOW->m_ruleApplicator->alpha().valueOrDefault().alpha, sc<bool>(ParserUtils::parseInt(VAL).value_or(0))}, Desktop::Types::PRIORITY_SET_PROP)); } else if (PROP == "opacity_inactive_override") { PWINDOW->m_ruleApplicator->alphaInactiveOverride(Desktop::Types::COverridableVar( - Desktop::Types::SAlphaValue{PWINDOW->m_ruleApplicator->alphaInactive().valueOrDefault().alpha, sc<bool>(configStringToInt(VAL).value_or(0))}, + Desktop::Types::SAlphaValue{PWINDOW->m_ruleApplicator->alphaInactive().valueOrDefault().alpha, sc<bool>(ParserUtils::parseInt(VAL).value_or(0))}, Desktop::Types::PRIORITY_SET_PROP)); } else if (PROP == "opacity_fullscreen_override") { PWINDOW->m_ruleApplicator->alphaFullscreenOverride(Desktop::Types::COverridableVar( - Desktop::Types::SAlphaValue{PWINDOW->m_ruleApplicator->alphaFullscreen().valueOrDefault().alpha, sc<bool>(configStringToInt(VAL).value_or(0))}, + Desktop::Types::SAlphaValue{PWINDOW->m_ruleApplicator->alphaFullscreen().valueOrDefault().alpha, sc<bool>(ParserUtils::parseInt(VAL).value_or(0))}, Desktop::Types::PRIORITY_SET_PROP)); } else if (PROP == "allows_input") parsePropTrivial(PWINDOW->m_ruleApplicator->allowsInput(), VAL); |
