Skip to content

Commit

Permalink
✨ Keybind for reseting zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
trickypr committed Jan 5, 2024
1 parent ab0ab52 commit 58f67b6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
on:command={() =>
runOnCurrentTab((tab) => tab.zoom.update((zoom) => zoom - 0.1))}
/>
<Keybinding
pref="browser.keybinds.zoomReset"
on:command={() => runOnCurrentTab((tab) => tab.zoom.set(1))}
/>

{#each [1, 2, 3, 4, 5, 6, 7, 8] as tabNum}
<Keybinding
Expand Down
1 change: 1 addition & 0 deletions apps/content/src/settings/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@

<StringPref pref="browser.keybinds.zoomIn">Zoom in</StringPref>
<StringPref pref="browser.keybinds.zoomOut">Zoom out</StringPref>
<StringPref pref="browser.keybinds.zoomReset">Reset Zoom</StringPref>

{#each [1, 2, 3, 4, 5, 6, 7, 8] as tabNum}
<StringPref pref={`browser.keybinds.tab${tabNum}`}
Expand Down
1 change: 1 addition & 0 deletions apps/misc/static/defaults/pref/prefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ pref('browser.keybinds.nextTab', 'accel+VK_TAB');
pref('browser.keybinds.previousTab', 'accel+shift+VK_TAB');
pref('browser.keybinds.zoomIn', 'accel+=');
pref('browser.keybinds.zoomOut', 'accel+-');
pref('browser.keybinds.zoomReset', 'accel+0');
pref('browser.keybinds.tab1', 'accel+1');
pref('browser.keybinds.tab2', 'accel+2');
pref('browser.keybinds.tab3', 'accel+3');
Expand Down
1 change: 1 addition & 0 deletions apps/modules/lib/ZoomStore.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class ZoomStoreImpl {

if (zoom === 1) {
this.zoomPages?.delete(uri.host)
this.events.emit('setZoom', { host: uri.host, zoom })
return
}

Expand Down

0 comments on commit 58f67b6

Please sign in to comment.