From a0f95ff127d0f8269f6489a6e92956917e08d640 Mon Sep 17 00:00:00 2001 From: Florian Bachmann Date: Tue, 28 May 2024 13:56:15 +0200 Subject: [PATCH] Adds config option 'zoomWheel' --- package.json | 6 ++++++ src/Config.ts | 17 +++++++++++++++++ src/DrawioClient/DrawioClientFactory.ts | 1 + 3 files changed, 24 insertions(+) diff --git a/package.json b/package.json index fbde4cf..a363821 100644 --- a/package.json +++ b/package.json @@ -411,6 +411,12 @@ "title": "Draw.io zoom factor", "description": "Defines the zoom factor for mouse wheel and trackpad zoom." }, + "hediet.vscode-drawio.zoomWheel": { + "type": "boolean", + "default": false, + "title": "Draw.io zoom wheel option", + "description": "Defines whether zoom is possible without meta key, i.e. only using mouse wheel without Ctrl/Alt/Cmd." + }, "hediet.vscode-drawio.globalVars": { "type": "object", "title": "Draw.io global variables.", diff --git a/src/Config.ts b/src/Config.ts index 6e164fa..3cbba28 100644 --- a/src/Config.ts +++ b/src/Config.ts @@ -629,6 +629,23 @@ export class DiagramConfig { // #endregion + // #region Zoom Wheel + + private readonly _zoomWheel = new VsCodeSetting( + `${extensionId}.zoomWheel`, + { + scope: this.uri, + serializer: serializerWithDefault(false), + } + ); + + @computed + public get zoomWheel(): boolean { + return this._zoomWheel.get(); + } + + // #endregion + // #region Global Variables private readonly _globalVars = new VsCodeSetting( diff --git a/src/DrawioClient/DrawioClientFactory.ts b/src/DrawioClient/DrawioClientFactory.ts index 67ee774..381817d 100644 --- a/src/DrawioClient/DrawioClientFactory.ts +++ b/src/DrawioClient/DrawioClientFactory.ts @@ -96,6 +96,7 @@ export class DrawioClientFactory { defaultLibraries: "general", libraries: simpleDrawioLibrary(libs), zoomFactor: config.zoomFactor, + zoomWheel: config.zoomWheel, globalVars: config.globalVars, }; },