From 7ecdf5044b8223cb30ab95655456d04482de18e7 Mon Sep 17 00:00:00 2001 From: Ashvin Jangid <142579833+ashvwinn@users.noreply.github.com> Date: Thu, 4 Jun 2026 16:47:36 +0530 Subject: [PATCH] feat: add a "100%" size override value in boosts --- src/zen/boosts/ZenBoostsEditor.mjs | 18 ++++++++++++++---- src/zen/boosts/ZenBoostsManager.sys.mjs | 2 +- src/zen/boosts/actors/ZenBoostsChild.sys.mjs | 2 +- src/zen/boosts/zen-boosts.css | 5 +++++ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/zen/boosts/ZenBoostsEditor.mjs b/src/zen/boosts/ZenBoostsEditor.mjs index c65b45e16e..2cc942dab1 100644 --- a/src/zen/boosts/ZenBoostsEditor.mjs +++ b/src/zen/boosts/ZenBoostsEditor.mjs @@ -639,7 +639,7 @@ ${cssSelector} { * Handles the size toggle button press, cycling through size override options */ onBoostSizePressed() { - if (this.currentBoostData.sizeOverride == 1) { + if (this.currentBoostData.sizeOverride == 0) { this.currentBoostData.sizeOverride = 1.1; } else if (this.currentBoostData.sizeOverride == 1.1) { this.currentBoostData.sizeOverride = 1.25; @@ -649,6 +649,8 @@ ${cssSelector} { this.currentBoostData.sizeOverride = 0.9; } else if (this.currentBoostData.sizeOverride == 0.9) { this.currentBoostData.sizeOverride = 1; + } else if (this.currentBoostData.sizeOverride == 1) { + this.currentBoostData.sizeOverride = 0; } this.updateSizeButtonVisuals(); @@ -1120,7 +1122,7 @@ ${cssSelector} { const sizeValue = this.doc.getElementById("zen-boost-size-value"); switch (this.currentBoostData.sizeOverride) { - case 1: + case 0: sizeButton.setAttribute("mode", "none"); sizeText.style.display = "initial"; sizeValue.style.display = "none"; @@ -1145,6 +1147,11 @@ ${cssSelector} { sizeText.style.display = "none"; sizeValue.style.display = "initial"; break; + case 1: + sizeButton.setAttribute("mode", "green"); + sizeText.style.display = "none"; + sizeValue.style.display = "initial"; + break; } sizeValue.setHTML( `${Math.round(this.currentBoostData.sizeOverride * 100)}%` @@ -1581,8 +1588,11 @@ ${cssSelector} { const gradient = this.doc.querySelector(".zen-boost-color-picker-gradient"); const rect = gradient.getBoundingClientRect(); - if (!this.currentBoostData.sizeOverride) { - this.currentBoostData.sizeOverride = 1; + if ( + !this.currentBoostData.sizeOverride && + this.currentBoostData.sizeOverride !== 0 + ) { + this.currentBoostData.sizeOverride = 0; } if ( diff --git a/src/zen/boosts/ZenBoostsManager.sys.mjs b/src/zen/boosts/ZenBoostsManager.sys.mjs index 0a84833d1e..93049a354a 100644 --- a/src/zen/boosts/ZenBoostsManager.sys.mjs +++ b/src/zen/boosts/ZenBoostsManager.sys.mjs @@ -137,7 +137,7 @@ class nsZenBoostsManager { autoTheme: false, textCaseOverride: "none", - sizeOverride: 1, + sizeOverride: 0, zapSelectors: [], customCSS: "", diff --git a/src/zen/boosts/actors/ZenBoostsChild.sys.mjs b/src/zen/boosts/actors/ZenBoostsChild.sys.mjs index 597a74c098..2ffd858526 100644 --- a/src/zen/boosts/actors/ZenBoostsChild.sys.mjs +++ b/src/zen/boosts/actors/ZenBoostsChild.sys.mjs @@ -359,7 +359,7 @@ export class ZenBoostsChild extends JSWindowActorChild { if ( boostData.sizeOverride && isFinite(boostData.sizeOverride) && - boostData.sizeOverride !== 1 + boostData.sizeOverride !== 0 ) { browsingContext.fullZoom = boostData.sizeOverride; } diff --git a/src/zen/boosts/zen-boosts.css b/src/zen/boosts/zen-boosts.css index 4537642f28..0019e47f02 100644 --- a/src/zen/boosts/zen-boosts.css +++ b/src/zen/boosts/zen-boosts.css @@ -627,6 +627,11 @@ body { --mod-button-c1: light-dark(#6650fc, #5d56ca); --mod-button-c2: light-dark(#4125ff, #453aa9); } +.mod-button[mode="green"] { + color: #e3e9e4; + --mod-button-c1: light-dark(#2dd75d, #187432); + --mod-button-c2: light-dark(#23a849, #0c3919); +} .mod-button[mode] { background: linear-gradient(180deg, var(--mod-button-c1) 0%, var(--mod-button-c2) 100%) border-box; transition: