Skip to content

Commit e235ac6

Browse files
committed
fix: Fixed glance button cancelation not working, b=no-bug, c=glance, workspaces
1 parent 69c8e6a commit e235ac6

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

src/zen/glance/ZenGlanceManager.mjs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,9 @@
259259
}
260260
}
261261

262-
const browserSidebarContainer = this.#currentParentTab?.linkedBrowser?.closest(
263-
'.browserSidebarContainer'
264-
);
265-
if (onTabClose && hasFocused && !this.#confirmationTimeout && browserSidebarContainer) {
266-
const cancelButton = browserSidebarContainer?.querySelector('.zen-glance-sidebar-close');
262+
const sidebarButtons = this.browserWrapper.querySelector('.zen-glance-sidebar-container');
263+
if (onTabClose && hasFocused && !this.#confirmationTimeout && sidebarButtons) {
264+
const cancelButton = sidebarButtons?.querySelector('.zen-glance-sidebar-close');
267265
cancelButton.setAttribute('waitconfirmation', true);
268266
this.#confirmationTimeout = setTimeout(() => {
269267
cancelButton.removeAttribute('waitconfirmation');
@@ -274,7 +272,9 @@
274272

275273
this.browserWrapper.removeAttribute('has-finished-animation');
276274
if (noAnimation) {
277-
this._clearContainerStyles(browserSidebarContainer);
275+
this._clearContainerStyles(
276+
this.#currentParentTab?.linkedBrowser?.closest('.browserSidebarContainer')
277+
);
278278
this.quickCloseGlance({ closeCurrentTab: false });
279279
return;
280280
}
@@ -299,7 +299,6 @@
299299
this.overlay.style.pointerEvents = 'none';
300300
this.quickCloseGlance({ justAnimateParent: true, clearID: false });
301301
const originalPosition = this.#glances.get(this.#currentGlanceID).originalPosition;
302-
const sidebarButtons = this.browserWrapper.querySelector('.zen-glance-sidebar-container');
303302
if (sidebarButtons) {
304303
gZenUIManager.motion
305304
.animate(

src/zen/workspaces/ZenGradientGenerator.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,7 +1268,8 @@
12681268
getMostDominantColor(allColors) {
12691269
const color = this.getPrimaryColor(allColors);
12701270
if (typeof color === 'string') {
1271-
return this.hexToRgb(color);
1271+
// We found a custom color, we should rather return the native accent color
1272+
return this.getNativeAccentColor();
12721273
}
12731274
return color;
12741275
}
@@ -1448,15 +1449,14 @@
14481449
browser.document.documentElement.style.setProperty('--zen-primary-color', primaryColor);
14491450
browser.gZenThemePicker.isLegacyVersion = this.isLegacyVersion;
14501451
let isDarkMode = isDarkModeWindow;
1451-
const isUsingCustomColors = workspaceTheme.gradientColors.some((color) => color.isCustom);
1452-
if (!isDefaultTheme && !this.isLegacyVersion && !isUsingCustomColors) {
1452+
if (!isDefaultTheme && !this.isLegacyVersion) {
14531453
// Check for the primary color
14541454
isDarkMode = browser.gZenThemePicker.shouldBeDarkMode(dominantColor);
14551455
browser.document.documentElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
14561456
browser.gZenThemePicker.panel.removeAttribute('invalidate-controls');
14571457
} else {
14581458
browser.document.documentElement.removeAttribute('zen-should-be-dark-mode');
1459-
if (!this.isLegacyVersion && !isUsingCustomColors) {
1459+
if (!this.isLegacyVersion) {
14601460
browser.gZenThemePicker.panel.setAttribute('invalidate-controls', 'true');
14611461
}
14621462
}

surfer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"brandShortName": "Zen",
2020
"brandFullName": "Zen Browser",
2121
"release": {
22-
"displayVersion": "1.14.7b",
22+
"displayVersion": "1.14.8b",
2323
"github": {
2424
"repo": "zen-browser/desktop"
2525
},

0 commit comments

Comments
 (0)