From 5c836e6460ae5e8c290cfff61ec0d2d0e99dfa15 Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Sat, 16 Jul 2022 15:57:31 +0200 Subject: added master layout --- src/managers/LayoutManager.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/managers/LayoutManager.cpp') diff --git a/src/managers/LayoutManager.cpp b/src/managers/LayoutManager.cpp index ec723350..8e7e397b 100644 --- a/src/managers/LayoutManager.cpp +++ b/src/managers/LayoutManager.cpp @@ -4,8 +4,28 @@ IHyprLayout* CLayoutManager::getCurrentLayout() { switch (m_iCurrentLayoutID) { case DWINDLE: return &m_cDwindleLayout; + case MASTER: + return &m_cMasterLayout; } // fallback return &m_cDwindleLayout; +} + +void CLayoutManager::switchToLayout(std::string layout) { + if (layout == "dwindle") { + if (m_iCurrentLayoutID != DWINDLE) { + getCurrentLayout()->onDisable(); + m_iCurrentLayoutID = DWINDLE; + getCurrentLayout()->onEnable(); + } + } else if (layout == "master") { + if (m_iCurrentLayoutID != MASTER) { + getCurrentLayout()->onDisable(); + m_iCurrentLayoutID = MASTER; + getCurrentLayout()->onEnable(); + } + } else { + Debug::log(ERR, "Unknown layout %s!", layout.c_str()); + } } \ No newline at end of file -- cgit v1.2.3