blob: 86e45010c0e73866c19ca8d8cf3c55e11cdbbf91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include "LayoutManager.hpp"
IHyprLayout* CLayoutManager::getCurrentLayout() {
switch (m_iCurrentLayoutID) {
case LAYOUT_DWINDLE: return &m_cDwindleLayout;
case LAYOUT_MASTER: return &m_cMasterLayout;
}
// fallback
return &m_cDwindleLayout;
}
void CLayoutManager::switchToLayout(std::string layout) {
if (layout == "dwindle") {
if (m_iCurrentLayoutID != LAYOUT_DWINDLE) {
getCurrentLayout()->onDisable();
m_iCurrentLayoutID = LAYOUT_DWINDLE;
getCurrentLayout()->onEnable();
}
} else if (layout == "master") {
if (m_iCurrentLayoutID != LAYOUT_MASTER) {
getCurrentLayout()->onDisable();
m_iCurrentLayoutID = LAYOUT_MASTER;
getCurrentLayout()->onEnable();
}
} else {
Debug::log(ERR, "Unknown layout %s!", layout.c_str());
}
}
|