summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-16 15:57:31 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-07-16 15:57:31 +0200
commit5c836e6460ae5e8c290cfff61ec0d2d0e99dfa15 (patch)
treebb38dedd586738f0a1fe37b9a4234b754f54541d /src/managers
parent48e5bd96bc71f94f774eb92b00ef560b2f911c73 (diff)
added master layout
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/AnimationManager.cpp1
-rw-r--r--src/managers/LayoutManager.cpp20
-rw-r--r--src/managers/LayoutManager.hpp5
3 files changed, 25 insertions, 1 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp
index a8743afd..5d3027c9 100644
--- a/src/managers/AnimationManager.cpp
+++ b/src/managers/AnimationManager.cpp
@@ -191,7 +191,6 @@ void CAnimationManager::tick() {
} case AVARDAMAGE_SHADOW: {
RASSERT(PWINDOW, "Tried to AVARDAMAGE_SHADOW a non-window AVAR!");
- static auto* const PSHADOWSIZE = &g_pConfigManager->getConfigValuePtr("decoration:shadow_range")->intValue;
static auto* const PSHADOWIGNOREWINDOW = &g_pConfigManager->getConfigValuePtr("decoration:shadow_ignore_window")->intValue;
const auto PDECO = PWINDOW->getDecorationByType(DECORATION_SHADOW);
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
diff --git a/src/managers/LayoutManager.hpp b/src/managers/LayoutManager.hpp
index 20f1f7f9..aa340e79 100644
--- a/src/managers/LayoutManager.hpp
+++ b/src/managers/LayoutManager.hpp
@@ -1,20 +1,25 @@
#pragma once
#include "../layout/DwindleLayout.hpp"
+#include "../layout/MasterLayout.hpp"
class CLayoutManager {
public:
IHyprLayout* getCurrentLayout();
+ void switchToLayout(std::string);
+
private:
enum HYPRLAYOUTS {
DWINDLE = 0,
+ MASTER
};
HYPRLAYOUTS m_iCurrentLayoutID = DWINDLE;
CHyprDwindleLayout m_cDwindleLayout;
+ CHyprMasterLayout m_cMasterLayout;
};
inline std::unique_ptr<CLayoutManager> g_pLayoutManager; \ No newline at end of file