mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 11:56:36 +00:00
Disable widget dragging/splitting (#940)
This commit is contained in:
parent
1969e292f0
commit
c430cf0d88
@ -39,13 +39,14 @@ import {
|
|||||||
import { MessageService } from '@theia/core/lib/common/message-service';
|
import { MessageService } from '@theia/core/lib/common/message-service';
|
||||||
import URI from '@theia/core/lib/common/uri';
|
import URI from '@theia/core/lib/common/uri';
|
||||||
import {
|
import {
|
||||||
|
EditorCommands,
|
||||||
EditorMainMenu,
|
EditorMainMenu,
|
||||||
EditorManager,
|
EditorManager,
|
||||||
EditorOpenerOptions,
|
EditorOpenerOptions,
|
||||||
} from '@theia/editor/lib/browser';
|
} from '@theia/editor/lib/browser';
|
||||||
import { ProblemContribution } from '@theia/markers/lib/browser/problem/problem-contribution';
|
import { ProblemContribution } from '@theia/markers/lib/browser/problem/problem-contribution';
|
||||||
import { MonacoMenus } from '@theia/monaco/lib/browser/monaco-menu';
|
import { MonacoMenus } from '@theia/monaco/lib/browser/monaco-menu';
|
||||||
import { FileNavigatorContribution } from '@theia/navigator/lib/browser/navigator-contribution';
|
import { FileNavigatorCommands, FileNavigatorContribution } from '@theia/navigator/lib/browser/navigator-contribution';
|
||||||
import { OutlineViewContribution } from '@theia/outline-view/lib/browser/outline-view-contribution';
|
import { OutlineViewContribution } from '@theia/outline-view/lib/browser/outline-view-contribution';
|
||||||
import { OutputContribution } from '@theia/output/lib/browser/output-contribution';
|
import { OutputContribution } from '@theia/output/lib/browser/output-contribution';
|
||||||
import { ScmContribution } from '@theia/scm/lib/browser/scm-contribution';
|
import { ScmContribution } from '@theia/scm/lib/browser/scm-contribution';
|
||||||
@ -485,6 +486,18 @@ export class ArduinoFrontendContribution
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
for (const command of [
|
||||||
|
EditorCommands.SPLIT_EDITOR_DOWN,
|
||||||
|
EditorCommands.SPLIT_EDITOR_LEFT,
|
||||||
|
EditorCommands.SPLIT_EDITOR_RIGHT,
|
||||||
|
EditorCommands.SPLIT_EDITOR_UP,
|
||||||
|
EditorCommands.SPLIT_EDITOR_VERTICAL,
|
||||||
|
EditorCommands.SPLIT_EDITOR_HORIZONTAL,
|
||||||
|
FileNavigatorCommands.REVEAL_IN_NAVIGATOR
|
||||||
|
]) {
|
||||||
|
registry.unregisterCommand(command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
registerMenus(registry: MenuModelRegistry) {
|
registerMenus(registry: MenuModelRegistry) {
|
||||||
|
@ -9,6 +9,7 @@ import {
|
|||||||
} from '@theia/core/lib/browser/connection-status-service';
|
} from '@theia/core/lib/browser/connection-status-service';
|
||||||
import {
|
import {
|
||||||
ApplicationShell as TheiaApplicationShell,
|
ApplicationShell as TheiaApplicationShell,
|
||||||
|
DockPanel,
|
||||||
Panel,
|
Panel,
|
||||||
Widget,
|
Widget,
|
||||||
} from '@theia/core/lib/browser';
|
} from '@theia/core/lib/browser';
|
||||||
@ -74,6 +75,11 @@ export class ApplicationShell extends TheiaApplicationShell {
|
|||||||
return super.addWidget(widget, { ...options, ref });
|
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
|
// Avoid hiding top panel as we use it for arduino toolbar
|
||||||
protected createTopPanel(): Panel {
|
protected createTopPanel(): Panel {
|
||||||
const topPanel = super.createTopPanel();
|
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);
|
||||||
|
};
|
||||||
|
@ -11,7 +11,15 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
|
|||||||
registerCommands(commandRegistry: CommandRegistry): void {
|
registerCommands(commandRegistry: CommandRegistry): void {
|
||||||
super.registerCommands(commandRegistry);
|
super.registerCommands(commandRegistry);
|
||||||
|
|
||||||
for (const command of [CommonCommands.CONFIGURE_DISPLAY_LANGUAGE]) {
|
for (const command of [
|
||||||
|
CommonCommands.CONFIGURE_DISPLAY_LANGUAGE,
|
||||||
|
CommonCommands.CLOSE_TAB,
|
||||||
|
CommonCommands.CLOSE_SAVED_TABS,
|
||||||
|
CommonCommands.CLOSE_OTHER_TABS,
|
||||||
|
CommonCommands.CLOSE_ALL_TABS,
|
||||||
|
CommonCommands.COLLAPSE_PANEL,
|
||||||
|
CommonCommands.TOGGLE_MAXIMIZED,
|
||||||
|
]) {
|
||||||
commandRegistry.unregisterCommand(command);
|
commandRegistry.unregisterCommand(command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,10 +40,6 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
|
|||||||
CommonCommands.SELECT_ICON_THEME,
|
CommonCommands.SELECT_ICON_THEME,
|
||||||
CommonCommands.SELECT_COLOR_THEME,
|
CommonCommands.SELECT_COLOR_THEME,
|
||||||
CommonCommands.ABOUT_COMMAND,
|
CommonCommands.ABOUT_COMMAND,
|
||||||
CommonCommands.CLOSE_TAB,
|
|
||||||
CommonCommands.CLOSE_OTHER_TABS,
|
|
||||||
CommonCommands.CLOSE_ALL_TABS,
|
|
||||||
CommonCommands.COLLAPSE_PANEL,
|
|
||||||
CommonCommands.SAVE_WITHOUT_FORMATTING, // Patched for https://github.com/eclipse-theia/theia/pull/8877
|
CommonCommands.SAVE_WITHOUT_FORMATTING, // Patched for https://github.com/eclipse-theia/theia/pull/8877
|
||||||
]) {
|
]) {
|
||||||
registry.unregisterMenuAction(command);
|
registry.unregisterMenuAction(command);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user