Skip to content

Commit

Permalink
Fix: adjust scale for zen glance background and enhance quickCloseGla…
Browse files Browse the repository at this point in the history
…nce logic
  • Loading branch information
mauro-balades committed Nov 10, 2024
1 parent c8e363d commit 259b25a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/browser/base/content/zen-styles/zen-glance.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

#tabbrowser-tabpanels:has(.zen-glance-background) {
transform: scale(0.97);
transform: scale(0.98);
backdrop-filter: blur(5px);

& .zen-glance-background {
Expand Down
37 changes: 20 additions & 17 deletions src/browser/base/zen-components/ZenGlanceManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
this.browserWrapper.removeAttribute("animate-end");
this.overlay.setAttribute("fade-out", true);
window.requestAnimationFrame(() => {
this.quickCloseGlance({ justAnimateParent: true });
this.browserWrapper.setAttribute("animate", true);
setTimeout(() => {
if (!this.currentParentTab) {
Expand Down Expand Up @@ -227,26 +228,28 @@
this._duringOpening = false;
}

quickCloseGlance({ closeCurrentTab = true, closeParentTab = true } = {}) {
quickCloseGlance({ closeCurrentTab = true, closeParentTab = true, justAnimateParent = false } = {}) {
const parentHasBrowser = !!(this.currentParentTab.linkedBrowser);
if (parentHasBrowser) {
if (closeParentTab) {
this.currentParentTab.linkedBrowser.closest(".browserSidebarContainer").classList.remove("deck-selected");
if (!justAnimateParent) {
if (parentHasBrowser) {
if (closeParentTab) {
this.currentParentTab.linkedBrowser.closest(".browserSidebarContainer").classList.remove("deck-selected");
}
this.currentParentTab.linkedBrowser.zenModeActive = false;
}
this.currentParentTab.linkedBrowser.zenModeActive = false;
}
this.#currentBrowser.zenModeActive = false;
if (closeParentTab && parentHasBrowser) {
this.currentParentTab.linkedBrowser.docShellIsActive = false;
}
if (closeCurrentTab) {
this.#currentBrowser.docShellIsActive = false;
this.overlay.classList.remove("deck-selected");
}
if (!this.currentParentTab._visuallySelected && closeParentTab) {
this.currentParentTab._visuallySelected = false;
this.#currentBrowser.zenModeActive = false;
if (closeParentTab && parentHasBrowser) {
this.currentParentTab.linkedBrowser.docShellIsActive = false;
}
if (closeCurrentTab) {
this.#currentBrowser.docShellIsActive = false;
this.overlay.classList.remove("deck-selected");
}
if (!this.currentParentTab._visuallySelected && closeParentTab) {
this.currentParentTab._visuallySelected = false;
}
this.#currentBrowser.removeAttribute("zen-glance-selected");
}
this.#currentBrowser.removeAttribute("zen-glance-selected");
if (parentHasBrowser) {
this.currentParentTab.linkedBrowser.closest(".browserSidebarContainer").classList.remove("zen-glance-background");
}
Expand Down

0 comments on commit 259b25a

Please sign in to comment.