summaryrefslogtreecommitdiff
path: root/src/desktop/Workspace.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2024-03-03 18:39:20 +0000
committerVaxry <vaxry@vaxry.net>2024-03-03 18:41:38 +0000
commit063708df26e8b930f492200e1907eb47950f50e6 (patch)
tree31648b7148213ecb9c6d469148ac1c5061835d5a /src/desktop/Workspace.cpp
parent8ccbd272cc5f3a98280d4e050f456d25aee47ee5 (diff)
config: improve config value infrastructure
Diffstat (limited to 'src/desktop/Workspace.cpp')
-rw-r--r--src/desktop/Workspace.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/desktop/Workspace.cpp b/src/desktop/Workspace.cpp
index e2ba1d5a..470d23e6 100644
--- a/src/desktop/Workspace.cpp
+++ b/src/desktop/Workspace.cpp
@@ -1,5 +1,6 @@
#include "Workspace.hpp"
#include "../Compositor.hpp"
+#include "../config/ConfigValue.hpp"
CWorkspace::CWorkspace(int monitorID, std::string name, bool special) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(monitorID);
@@ -42,8 +43,8 @@ CWorkspace::~CWorkspace() {
}
void CWorkspace::startAnim(bool in, bool left, bool instant) {
- const auto ANIMSTYLE = m_fAlpha.m_pConfig->pValues->internalStyle;
- static auto* const PWORKSPACEGAP = (Hyprlang::INT* const*)g_pConfigManager->getConfigValuePtr("general:gaps_workspaces");
+ const auto ANIMSTYLE = m_fAlpha.m_pConfig->pValues->internalStyle;
+ static auto PWORKSPACEGAP = CConfigValue<Hyprlang::INT>("general:gaps_workspaces");
if (ANIMSTYLE.starts_with("slidefade")) {
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
@@ -95,7 +96,7 @@ void CWorkspace::startAnim(bool in, bool left, bool instant) {
} else if (ANIMSTYLE == "slidevert") {
// fallback is slide
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
- const auto YDISTANCE = PMONITOR->vecSize.y + **PWORKSPACEGAP;
+ const auto YDISTANCE = PMONITOR->vecSize.y + *PWORKSPACEGAP;
m_fAlpha.setValueAndWarp(1.f); // fix a bug, if switching from fade -> slide.
@@ -108,7 +109,7 @@ void CWorkspace::startAnim(bool in, bool left, bool instant) {
} else {
// fallback is slide
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
- const auto XDISTANCE = PMONITOR->vecSize.x + **PWORKSPACEGAP;
+ const auto XDISTANCE = PMONITOR->vecSize.x + *PWORKSPACEGAP;
m_fAlpha.setValueAndWarp(1.f); // fix a bug, if switching from fade -> slide.