diff options
| author | Vaxry <43317083+vaxerski@users.noreply.github.com> | 2026-04-26 15:16:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-26 15:16:36 +0100 |
| commit | 5ba33f846129f3e6c0505b19f94634b24505e828 (patch) | |
| tree | aaacabe678006040c342935481a86607c66607fd /src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp | |
| parent | 329b2b356dd92ac07f4e2aa69cbce82ee9ba9d19 (diff) | |
config/lua: init lua config manager, use lua if available (#13817)
Adds a new lua config manager, which will automatically be used if there is a lua config present.
Diffstat (limited to 'src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp')
| -rw-r--r-- | src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp index 043f8738..9216e843 100644 --- a/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp +++ b/src/layout/algorithm/tiled/dwindle/DwindleAlgorithm.hpp @@ -5,7 +5,25 @@ namespace Layout { } namespace Layout::Tiled { - struct SDwindleNodeData; + struct SDwindleNodeData { + WP<SDwindleNodeData> pParent; + bool isNode = false; + WP<ITarget> pTarget; + std::array<WP<SDwindleNodeData>, 2> children = {}; + WP<SDwindleNodeData> self; + bool splitTop = false; // for preserve_split + CBox box = {0}; + float splitRatio = 1.f; + bool valid = true; + bool ignoreFullscreenChecks = false; + + // For list lookup + bool operator==(const SDwindleNodeData& rhs) const { + return pTarget.lock() == rhs.pTarget.lock() && box == rhs.box && pParent == rhs.pParent && children[0] == rhs.children[0] && children[1] == rhs.children[1]; + } + + void recalcSizePosRecursive(bool force = false, bool horizontalOverride = false, bool verticalOverride = false); + }; class CDwindleAlgorithm : public ITiledAlgorithm { public: @@ -27,6 +45,8 @@ namespace Layout::Tiled { virtual void swapTargets(SP<ITarget> a, SP<ITarget> b); virtual void moveTargetInDirection(SP<ITarget> t, Math::eDirection dir, bool silent); + SP<SDwindleNodeData> getNodeFromWindow(PHLWINDOW w); + private: std::vector<SP<SDwindleNodeData>> m_dwindleNodesData; @@ -42,7 +62,6 @@ namespace Layout::Tiled { void addTarget(SP<ITarget> target); void calculateWorkspace(); SP<SDwindleNodeData> getNodeFromTarget(SP<ITarget>); - SP<SDwindleNodeData> getNodeFromWindow(PHLWINDOW w); int getNodes(); SP<SDwindleNodeData> getFirstNode(); SP<SDwindleNodeData> getClosestNode(const Vector2D&, SP<ITarget> skip = nullptr); |
