From 17b4a2786dda1160aca0e3991ed87ae63efd1cac Mon Sep 17 00:00:00 2001 From: vaxerski Date: Mon, 26 Dec 2022 12:05:34 +0100 Subject: [PATCH] clarify layout enum --- src/managers/LayoutManager.cpp | 12 ++++++------ src/managers/LayoutManager.hpp | 9 ++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/managers/LayoutManager.cpp b/src/managers/LayoutManager.cpp index 8e352184..86e45010 100644 --- a/src/managers/LayoutManager.cpp +++ b/src/managers/LayoutManager.cpp @@ -2,8 +2,8 @@ IHyprLayout* CLayoutManager::getCurrentLayout() { switch (m_iCurrentLayoutID) { - case DWINDLE: return &m_cDwindleLayout; - case MASTER: return &m_cMasterLayout; + case LAYOUT_DWINDLE: return &m_cDwindleLayout; + case LAYOUT_MASTER: return &m_cMasterLayout; } // fallback @@ -12,15 +12,15 @@ IHyprLayout* CLayoutManager::getCurrentLayout() { void CLayoutManager::switchToLayout(std::string layout) { if (layout == "dwindle") { - if (m_iCurrentLayoutID != DWINDLE) { + if (m_iCurrentLayoutID != LAYOUT_DWINDLE) { getCurrentLayout()->onDisable(); - m_iCurrentLayoutID = DWINDLE; + m_iCurrentLayoutID = LAYOUT_DWINDLE; getCurrentLayout()->onEnable(); } } else if (layout == "master") { - if (m_iCurrentLayoutID != MASTER) { + if (m_iCurrentLayoutID != LAYOUT_MASTER) { getCurrentLayout()->onDisable(); - m_iCurrentLayoutID = MASTER; + m_iCurrentLayoutID = LAYOUT_MASTER; getCurrentLayout()->onEnable(); } } else { diff --git a/src/managers/LayoutManager.hpp b/src/managers/LayoutManager.hpp index 103aa7b9..b14b989f 100644 --- a/src/managers/LayoutManager.hpp +++ b/src/managers/LayoutManager.hpp @@ -10,13 +10,12 @@ class CLayoutManager { void switchToLayout(std::string); private: - enum HYPRLAYOUTS - { - DWINDLE = 0, - MASTER + enum HYPRLAYOUTS { + LAYOUT_DWINDLE = 0, + LAYOUT_MASTER }; - HYPRLAYOUTS m_iCurrentLayoutID = DWINDLE; + HYPRLAYOUTS m_iCurrentLayoutID = LAYOUT_DWINDLE; CHyprDwindleLayout m_cDwindleLayout; CHyprMasterLayout m_cMasterLayout;