mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-08-03 11:28:21 -04:00
Correctly set visual Zoom limits for Electron
This commit is contained in:
parent
80ddc9c6e9
commit
1e197c7707
@ -38,6 +38,10 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
openExternal: function (url) {
|
||||
ipcRenderer.send('open-external', url);
|
||||
},
|
||||
setZoomLimits: function (min, max) {
|
||||
console.log('Setting zoom limits to ' + min + ' and ' + max);
|
||||
webFrame.setVisualZoomLevelLimits(min, max);
|
||||
},
|
||||
isMicrosoftStoreApp: process.windowsStore && regexpInstalledFromMicrosoftStore.test(__dirname),
|
||||
__dirname: __dirname,
|
||||
on: function (event, callback) {
|
||||
@ -63,9 +67,6 @@ contextBridge.exposeInMainWorld('dialog', {
|
||||
}
|
||||
});
|
||||
|
||||
// Enable pinch-to-zoom
|
||||
webFrame.setVisualZoomLevelLimits(1, 3);
|
||||
|
||||
// window.Buffer = Buffer;
|
||||
|
||||
// console.log(win.session.cookies);
|
||||
|
@ -1822,6 +1822,8 @@ if (window.electronAPI) {
|
||||
}, 250);
|
||||
}
|
||||
});
|
||||
// Set the Zoom values for the window
|
||||
electronAPI.setZoomLimits(1, 3);
|
||||
}
|
||||
document.getElementById('disableDragAndDropCheck').addEventListener('change', function () {
|
||||
params.disableDragAndDrop = this.checked;
|
||||
|
Loading…
x
Reference in New Issue
Block a user