clarify layout enum

This commit is contained in:
vaxerski 2022-12-26 12:05:34 +01:00
parent cd08fa22fd
commit 17b4a2786d
2 changed files with 10 additions and 11 deletions

View File

@ -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 {

View File

@ -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;