Added togglesplit dispatcher
This commit is contained in:
parent
e90c1f7022
commit
50f978e518
5 changed files with 46 additions and 13 deletions
|
|
@ -832,5 +832,25 @@ void CHyprDwindleLayout::alterSplitRatioBy(CWindow* pWindow, float ratio) {
|
|||
|
||||
PNODE->pParent->splitRatio = std::clamp(PNODE->pParent->splitRatio + ratio, 0.1f, 1.9f);
|
||||
|
||||
PNODE->pParent->recalcSizePosRecursive();
|
||||
}
|
||||
|
||||
void CHyprDwindleLayout::layoutMessage(SLayoutMessageHeader header, std::string message) {
|
||||
if (message == "togglegroup")
|
||||
toggleWindowGroup(header.pWindow);
|
||||
else if (message == "changegroupactive")
|
||||
switchGroupWindow(header.pWindow);
|
||||
else if (message == "togglesplit")
|
||||
toggleSplit(header.pWindow);
|
||||
}
|
||||
|
||||
void CHyprDwindleLayout::toggleSplit(CWindow* pWindow) {
|
||||
const auto PNODE = getNodeFromWindow(pWindow);
|
||||
|
||||
if (!PNODE || !PNODE->pParent)
|
||||
return;
|
||||
|
||||
PNODE->pParent->splitTop = !PNODE->pParent->splitTop;
|
||||
|
||||
PNODE->pParent->recalcSizePosRecursive();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue