Merge pull request #4225 from SiriusXT/master

Click the button to reset the zoom level
This commit is contained in:
zadam 2023-09-05 23:01:50 +02:00 committed by GitHub
commit 72b2a6ecb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -53,7 +53,10 @@ class ZoomComponent extends Component {
zoomInEvent() { zoomInEvent() {
this.setZoomFactorAndSave(this.getCurrentZoom() + 0.1); this.setZoomFactorAndSave(this.getCurrentZoom() + 0.1);
} }
zoomResetEvent() {
this.setZoomFactorAndSave(1);
}
setZoomFactorAndSaveEvent({zoomFactor}) { setZoomFactorAndSaveEvent({zoomFactor}) {
this.setZoomFactorAndSave(zoomFactor); this.setZoomFactorAndSave(zoomFactor);
} }

View File

@ -131,7 +131,7 @@ const TPL = `
<a data-trigger-command="zoomOut" title="Zoom Out" class="bx bx-minus"></a> <a data-trigger-command="zoomOut" title="Zoom Out" class="bx bx-minus"></a>
<span class="zoom-state"></span> <span data-trigger-command="zoomReset" title="Reset Zoom Level" class="zoom-state"></span>
<a data-trigger-command="zoomIn" title="Zoom In" class="bx bx-plus"></a> <a data-trigger-command="zoomIn" title="Zoom In" class="bx bx-plus"></a>
</div> </div>

View File

@ -495,6 +495,12 @@ const DEFAULT_KEYBOARD_ACTIONS = [
defaultShortcuts: isElectron ? ["CommandOrControl+="] : [], defaultShortcuts: isElectron ? ["CommandOrControl+="] : [],
scope: "window" scope: "window"
}, },
{
actionName: "zoomReset",
description: "Reset zoom level",
defaultShortcuts: isElectron ? ["CommandOrControl+0"] : [],
scope: "window"
},
{ {
actionName: "copyWithoutFormatting", actionName: "copyWithoutFormatting",
defaultShortcuts: ["CommandOrControl+Alt+C"], defaultShortcuts: ["CommandOrControl+Alt+C"],