mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Add togglesplit
This commit is contained in:
parent
ec783b0480
commit
38f7b4f095
2 changed files with 21 additions and 1 deletions
|
@ -959,6 +959,26 @@ void Hy3Layout::fullscreenRequestForWindow(CWindow* window, eFullscreenMode full
|
|||
}
|
||||
|
||||
std::any Hy3Layout::layoutMessage(SLayoutMessageHeader header, std::string content) {
|
||||
if (content == "togglesplit") {
|
||||
auto* node = this->getNodeFromWindow(header.pWindow);
|
||||
if (node != nullptr && node->parent != nullptr) {
|
||||
auto& layout = node->parent->data.as_group.layout;
|
||||
|
||||
switch (layout) {
|
||||
case Hy3GroupLayout::SplitH:
|
||||
layout = Hy3GroupLayout::SplitV;
|
||||
node->parent->recalcSizePosRecursive();
|
||||
break;
|
||||
case Hy3GroupLayout::SplitV:
|
||||
layout = Hy3GroupLayout::SplitH;
|
||||
node->parent->recalcSizePosRecursive();
|
||||
break;
|
||||
case Hy3GroupLayout::Tabbed:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ void setup_selection_hook() {
|
|||
return;
|
||||
}
|
||||
|
||||
g_LastSelectionHook = HyprlandAPI::createFunctionHook(PHANDLE, decoUpdateCandidates[0].address, (void *)&hook_update_decos);
|
||||
g_LastSelectionHook = HyprlandAPI::createFunctionHook(PHANDLE, decoUpdateCandidates[0].address, (void*)&hook_update_decos);
|
||||
}
|
||||
|
||||
g_LastSelectionHook->hook();
|
||||
|
|
Loading…
Add table
Reference in a new issue