mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-01 18:55:02 +03:00
clarify layout enum
This commit is contained in:
parent
cd08fa22fd
commit
17b4a2786d
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user