Disable widget dragging/splitting (#940)

This commit is contained in:
Mark Sujew
2022-04-05 12:21:49 +02:00
committed by GitHub
parent 1969e292f0
commit c430cf0d88
3 changed files with 49 additions and 13 deletions

View File

@@ -9,6 +9,7 @@ import {
} from '@theia/core/lib/browser/connection-status-service';
import {
ApplicationShell as TheiaApplicationShell,
DockPanel,
Panel,
Widget,
} from '@theia/core/lib/browser';
@@ -74,6 +75,11 @@ export class ApplicationShell extends TheiaApplicationShell {
return super.addWidget(widget, { ...options, ref });
}
handleEvent(): boolean {
// NOOP, dragging has been disabled
return false
}
// Avoid hiding top panel as we use it for arduino toolbar
protected createTopPanel(): Panel {
const topPanel = super.createTopPanel();
@@ -101,3 +107,16 @@ export class ApplicationShell extends TheiaApplicationShell {
);
}
}
const originalHandleEvent = DockPanel.prototype.handleEvent;
DockPanel.prototype.handleEvent = function (event) {
switch (event.type) {
case 'p-dragenter':
case 'p-dragleave':
case 'p-dragover':
case 'p-drop':
return;
}
originalHandleEvent(event);
};