diff --git a/apps/content/src/browser/components/keybindings/Keybindings.svelte b/apps/content/src/browser/components/keybindings/Keybindings.svelte index 6145b5a..a1e9535 100644 --- a/apps/content/src/browser/components/keybindings/Keybindings.svelte +++ b/apps/content/src/browser/components/keybindings/Keybindings.svelte @@ -43,6 +43,18 @@ pref="browser.keybinds.previousTab" on:command={() => setCurrentTabIndex(getCurrentTabIndex() - 1)} /> + + + runOnCurrentTab((tab) => tab.zoom.update((zoom) => zoom + 0.1))} + /> + + runOnCurrentTab((tab) => tab.zoom.update((zoom) => zoom - 0.1))} + /> + {#each [1, 2, 3, 4, 5, 6, 7, 8] as tabNum} + zoom.set(1)} /> + {#each $pageActions as [_extId, pageAction]} {#if pageAction.shouldShow($uri.asciiSpec, tab.getTabId())} diff --git a/apps/content/src/browser/components/omnibox/ZoomDisplay.svelte b/apps/content/src/browser/components/omnibox/ZoomDisplay.svelte new file mode 100644 index 0000000..e1fb3da --- /dev/null +++ b/apps/content/src/browser/components/omnibox/ZoomDisplay.svelte @@ -0,0 +1,24 @@ + + +{#if zoom != 1} + +{/if} + + diff --git a/apps/content/src/browser/lib/window/tab.ts b/apps/content/src/browser/lib/window/tab.ts index bdfe823..ca6da5e 100644 --- a/apps/content/src/browser/lib/window/tab.ts +++ b/apps/content/src/browser/lib/window/tab.ts @@ -43,6 +43,8 @@ export class Tab { public loading = writable(false) public loadingProgress = writable(0) + public zoom = writable(1) + /** * This is used by the omnibox to determine if text input should be focused. */ @@ -59,6 +61,11 @@ export class Tab { this.goToUri(uri) this.title.set(uri.asciiHost) + this.zoom.subscribe( + (newZoom) => + this.browserElement.browsingContext && + (this.browserElement.fullZoom = newZoom), + ) this.uri.subscribe(async (uri) => this.bookmarkInfo.set( await search({ url: uri.spec }).then((r) => @@ -156,6 +163,9 @@ export class Tab { this.uri.set(event.aLocation) this.canGoBack.set(this.browserElement.canGoBack) this.canGoForward.set(this.browserElement.canGoForward) + this.zoom.set( + this.browserElement.browsingContext ? this.browserElement.fullZoom : 1, + ) }) this.progressListener.events.on('progressPercent', this.loadingProgress.set) diff --git a/apps/content/src/settings/Settings.svelte b/apps/content/src/settings/Settings.svelte index 67de213..80c0ff5 100644 --- a/apps/content/src/settings/Settings.svelte +++ b/apps/content/src/settings/Settings.svelte @@ -75,6 +75,9 @@ Next tab Previous Tab + Zoom in + Zoom out + {#each [1, 2, 3, 4, 5, 6, 7, 8] as tabNum} Jump to tab {tabNum}