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.
(cherry-picked from commit 982904e2ba)
This commit is contained in:
@@ -271,7 +271,8 @@ int main(int argc, char **argv)
|
||||
// Dock widget 8 will only be allowed to dock to the outter areas
|
||||
auto func = [](KDDockWidgets::DropLocation location,
|
||||
const KDDockWidgets::Controllers::DockWidget::List &source,
|
||||
const KDDockWidgets::Controllers::DockWidget::List &target) {
|
||||
const KDDockWidgets::Controllers::DockWidget::List &target,
|
||||
Controllers::DropArea *) {
|
||||
Q_UNUSED(target); // When dragging into a tab, 'target' would have the list of already tabbed dock widgets
|
||||
|
||||
const bool isDraggingDW8 = std::find_if(source.cbegin(), source.cend(), [](KDDockWidgets::Controllers::DockWidget *dw) {
|
||||
|
||||
Reference in New Issue
Block a user