summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorFilip Mikina <fm394471@students.mimuw.edu.pl>2025-10-24 21:18:39 +0200
committerGitHub <noreply@github.com>2025-10-24 20:18:39 +0100
commit34812c33dbfdac33093c84b3edf5076838cbf2a6 (patch)
tree8aa0ab0b23e6944175e9594ffe37e0a5d3ace1d0 /src/config/ConfigManager.cpp
parent117e38db35a8bdd98f0210d41b83b4bb0e5e6a63 (diff)
hyprctl: include color management presets and sdr information (#12019)
* move string parsing for eCMType to its own namespace, similar to how `src/protocols/types/ContentType.cpp` is done * expose cm type and sdr settings in `hyprctl monitors`, format floats to .2f
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index 151941fe..0e88fca3 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -2273,28 +2273,12 @@ bool CMonitorRuleParser::parseBitdepth(const std::string& value) {
}
bool CMonitorRuleParser::parseCM(const std::string& value) {
- if (value == "auto")
- m_rule.cmType = CM_AUTO;
- else if (value == "srgb")
- m_rule.cmType = CM_SRGB;
- else if (value == "wide")
- m_rule.cmType = CM_WIDE;
- else if (value == "edid")
- m_rule.cmType = CM_EDID;
- else if (value == "hdr")
- m_rule.cmType = CM_HDR;
- else if (value == "hdredid")
- m_rule.cmType = CM_HDR_EDID;
- else if (value == "dcip3")
- m_rule.cmType = CM_DCIP3;
- else if (value == "dp3")
- m_rule.cmType = CM_DP3;
- else if (value == "adobe")
- m_rule.cmType = CM_ADOBE;
- else {
+ auto parsedCM = NCMType::fromString(value);
+ if (!parsedCM.has_value()) {
m_error += "invalid cm ";
return false;
}
+ m_rule.cmType = parsedCM.value();
return true;
}