mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +02:00
This commit is contained in:
parent
df577bc08c
commit
56dce15537
@ -99,6 +99,11 @@ export default class ElectronAppWrapper {
|
||||
return null;
|
||||
}
|
||||
|
||||
public allAppWindows() {
|
||||
const allWindowIds = [...this.secondaryWindows_.keys(), defaultWindowId];
|
||||
return allWindowIds.map(id => this.windowById(id));
|
||||
}
|
||||
|
||||
public env() {
|
||||
return this.env_;
|
||||
}
|
||||
@ -358,6 +363,9 @@ export default class ElectronAppWrapper {
|
||||
const electronWindowId = window?.id;
|
||||
this.secondaryWindows_.set(windowId, { electronId: electronWindowId });
|
||||
|
||||
// Match the main window's zoom:
|
||||
window.webContents.setZoomFactor(this.mainWindow().webContents.getZoomFactor());
|
||||
|
||||
window.once('close', () => {
|
||||
this.secondaryWindows_.delete(windowId);
|
||||
|
||||
|
@ -29,7 +29,7 @@ import { reg } from '@joplin/lib/registry';
|
||||
const packageInfo: PackageInfo = require('./packageInfo.js');
|
||||
import DecryptionWorker from '@joplin/lib/services/DecryptionWorker';
|
||||
import ClipperServer from '@joplin/lib/ClipperServer';
|
||||
import { ipcRenderer, webFrame } from 'electron';
|
||||
import { ipcRenderer } from 'electron';
|
||||
const Menu = bridge().Menu;
|
||||
const PluginManager = require('@joplin/lib/services/PluginManager');
|
||||
import RevisionService from '@joplin/lib/services/RevisionService';
|
||||
@ -152,7 +152,7 @@ class Application extends BaseApplication {
|
||||
}
|
||||
|
||||
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'windowContentZoomFactor' || action.type === 'SETTING_UPDATE_ALL') {
|
||||
webFrame.setZoomFactor(Setting.value('windowContentZoomFactor') / 100);
|
||||
bridge().setZoomFactor(Setting.value('windowContentZoomFactor') / 100);
|
||||
}
|
||||
|
||||
if (action.type === 'SETTING_UPDATE_ONE' && action.key === 'linking.extraAllowedExtensions' || action.type === 'SETTING_UPDATE_ALL') {
|
||||
|
@ -285,6 +285,13 @@ export class Bridge {
|
||||
this.switchToWindow(defaultWindowId);
|
||||
}
|
||||
|
||||
// zoom should be in the range [0..1]
|
||||
public setZoomFactor(zoom: number) {
|
||||
for (const window of this.electronWrapper_.allAppWindows()) {
|
||||
window.webContents.setZoomFactor(zoom);
|
||||
}
|
||||
}
|
||||
|
||||
public showItemInFolder(fullPath: string) {
|
||||
return require('electron').shell.showItemInFolder(toSystemSlashes(fullPath));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user