From 0e80ecc5342db04c8c1f807fa6db4c703fb89e3a Mon Sep 17 00:00:00 2001 From: davc0n Date: Thu, 24 Apr 2025 20:49:49 +0200 Subject: layers: refactor class member vars (#10149) * layers: refactor class member vars * popups: rename m_WLSurface to m_wlSurface --- src/desktop/LayerRule.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'src/desktop/LayerRule.cpp') diff --git a/src/desktop/LayerRule.cpp b/src/desktop/LayerRule.cpp index 791a557e..c03d8968 100644 --- a/src/desktop/LayerRule.cpp +++ b/src/desktop/LayerRule.cpp @@ -7,32 +7,32 @@ static const auto RULES = std::unordered_set{"noanim", "blur", "blurpopups", "dimaround"}; static const auto RULES_PREFIX = std::unordered_set{"ignorealpha", "ignorezero", "xray", "animation", "order"}; -CLayerRule::CLayerRule(const std::string& rule_, const std::string& ns_) : targetNamespace(ns_), rule(rule_) { - const bool VALID = RULES.contains(rule) || std::any_of(RULES_PREFIX.begin(), RULES_PREFIX.end(), [&rule_](const auto& prefix) { return rule_.starts_with(prefix); }); +CLayerRule::CLayerRule(const std::string& rule_, const std::string& ns_) : m_targetNamespace(ns_), m_rule(rule_) { + const bool VALID = RULES.contains(m_rule) || std::any_of(RULES_PREFIX.begin(), RULES_PREFIX.end(), [&rule_](const auto& prefix) { return rule_.starts_with(prefix); }); if (!VALID) return; - if (rule == "noanim") - ruleType = RULE_NOANIM; - else if (rule == "blur") - ruleType = RULE_BLUR; - else if (rule == "blurpopups") - ruleType = RULE_BLURPOPUPS; - else if (rule == "dimaround") - ruleType = RULE_DIMAROUND; - else if (rule.starts_with("ignorealpha")) - ruleType = RULE_IGNOREALPHA; - else if (rule.starts_with("ignorezero")) - ruleType = RULE_IGNOREZERO; - else if (rule.starts_with("xray")) - ruleType = RULE_XRAY; - else if (rule.starts_with("animation")) - ruleType = RULE_ANIMATION; - else if (rule.starts_with("order")) - ruleType = RULE_ORDER; + if (m_rule == "noanim") + m_ruleType = RULE_NOANIM; + else if (m_rule == "blur") + m_ruleType = RULE_BLUR; + else if (m_rule == "blurpopups") + m_ruleType = RULE_BLURPOPUPS; + else if (m_rule == "dimaround") + m_ruleType = RULE_DIMAROUND; + else if (m_rule.starts_with("ignorealpha")) + m_ruleType = RULE_IGNOREALPHA; + else if (m_rule.starts_with("ignorezero")) + m_ruleType = RULE_IGNOREZERO; + else if (m_rule.starts_with("xray")) + m_ruleType = RULE_XRAY; + else if (m_rule.starts_with("animation")) + m_ruleType = RULE_ANIMATION; + else if (m_rule.starts_with("order")) + m_ruleType = RULE_ORDER; else { Debug::log(ERR, "CLayerRule: didn't match a rule that was found valid?!"); - ruleType = RULE_INVALID; + m_ruleType = RULE_INVALID; } } \ No newline at end of file -- cgit v1.2.3