summaryrefslogtreecommitdiff
path: root/src/desktop/Window.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-11-18 23:53:38 +0000
committerVaxry <vaxry@vaxry.net>2024-11-18 23:53:38 +0000
commit47a1650c4810ad3cb3e9f125cb0addf18aa7395c (patch)
treefb95e7a329dd2fe25e585cc9f71ef2face932508 /src/desktop/Window.cpp
parent936dfedbadbae761cd307ba7509467b55ac5e1ae (diff)
miscfunctions: move configStringToInt to std::expected
Diffstat (limited to 'src/desktop/Window.cpp')
-rw-r--r--src/desktop/Window.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/desktop/Window.cpp b/src/desktop/Window.cpp
index e74e13a2..33e6a5f8 100644
--- a/src/desktop/Window.cpp
+++ b/src/desktop/Window.cpp
@@ -672,8 +672,8 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
// Basic form has only two colors, everything else can be parsed as a gradient
if (colorsAndAngles.size() == 2 && !colorsAndAngles[1].contains("deg")) {
- m_sWindowData.activeBorderColor = CWindowOverridableVar(CGradientValueData(CColor(configStringToInt(colorsAndAngles[0]))), priority);
- m_sWindowData.inactiveBorderColor = CWindowOverridableVar(CGradientValueData(CColor(configStringToInt(colorsAndAngles[1]))), priority);
+ m_sWindowData.activeBorderColor = CWindowOverridableVar(CGradientValueData(CColor(configStringToInt(colorsAndAngles[0]).value_or(0))), priority);
+ m_sWindowData.inactiveBorderColor = CWindowOverridableVar(CGradientValueData(CColor(configStringToInt(colorsAndAngles[1]).value_or(0))), priority);
return;
}
@@ -685,9 +685,9 @@ void CWindow::applyDynamicRule(const SWindowRule& r) {
} else if (token.contains("deg"))
inactiveBorderGradient.m_fAngle = std::stoi(token.substr(0, token.size() - 3)) * (PI / 180.0);
else if (active)
- activeBorderGradient.m_vColors.push_back(configStringToInt(token));
+ activeBorderGradient.m_vColors.push_back(configStringToInt(token).value_or(0));
else
- inactiveBorderGradient.m_vColors.push_back(configStringToInt(token));
+ inactiveBorderGradient.m_vColors.push_back(configStringToInt(token).value_or(0));
}
// Includes sanity checks for the number of colors in each gradient