Skip to content

Commit

Permalink
fix: zoom in with keyboard shortcut (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwyywm authored Sep 6, 2023
1 parent e6e177b commit c656879
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/renderer/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ export default function Layout() {
window.electron.browserWindow.reload(); // this is a hack; setSizes by itself does not seem to update the splits, seems like a bug, but we dont have a choice here
} else {
setOpenPreviewPane(digit);
const previewProvider = enabledProviders.find(
(provider) =>
provider.webviewId === storedPaneList[digit - 1].webviewId,
);
// @ts-ignore
const zoomLevel = previewProvider.getWebview()?.getZoomLevel() + 2;
// @ts-ignore
previewProvider.getWebview().setZoomLevel(zoomLevel);
}
} else if (isCmdOrCtrl && isShift && event.key.toLowerCase() === 'a') {
window.electron.browserWindow.reload();
Expand Down

0 comments on commit c656879

Please sign in to comment.