Pass the DropArea to setDropIndicatorAllowedFunc() too

So the lambda can have more advanced usage and inspect the
target layout before allowing or disallowing the drop.

For our use case, we want to limit max 3 dock widgets side by side,
for example.
This commit is contained in:
Sergio Martins
2022-06-02 15:19:01 +01:00
parent b2b75cd5bb
commit 982904e2ba
4 changed files with 13 additions and 5 deletions

View File

@@ -161,7 +161,8 @@ bool DropIndicatorOverlayInterface::dropIndicatorVisible(DropLocation dropLoc) c
}
if (auto dropIndicatorAllowedFunc = Config::self().dropIndicatorAllowedFunc()) {
if (!dropIndicatorAllowedFunc(dropLoc, source, target))
DropArea *dropArea = DragController::instance()->dropAreaUnderCursor();
if (!dropIndicatorAllowedFunc(dropLoc, source, target, dropArea))
return false;
}