Make shifting a node in a single node group always break that group

The shifted node will also inherit the size of the group
This commit is contained in:
outfoxxed 2023-06-21 21:18:44 -07:00
parent aec4d6b7da
commit 102360f96a
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E

View file

@ -1415,7 +1415,14 @@ void Hy3Layout::shiftWindow(int workspace, ShiftDirection direction, bool once)
Debug::log(LOG, "ShiftWindow %p %d", node, direction);
if (node == nullptr) return;
this->shiftOrGetFocus(*node, direction, true, once, false);
if (once && node->parent != nullptr && node->parent->data.as_group.children.size() == 1) {
auto* node2 = node->parent;
Hy3Node::swapData(*node, *node2);
node2->layout->nodes.remove(*node);
node2->recalcSizePosRecursive();
} else {
this->shiftOrGetFocus(*node, direction, true, once, false);
}
}
bool shiftIsForward(ShiftDirection direction) {