mirror of
https://github.com/zen-browser/desktop.git
synced 2026-08-27 17:01:30 +00:00
chore: Small quality fixes, b=no-bug, c=common, glance
This commit is contained in:
@@ -276,14 +276,17 @@ var gZenUIManager = {
|
||||
|
||||
onUrlbarOpen() {
|
||||
setTimeout(() => {
|
||||
const hadValid = gURLBar.getAttribute('pageproxystate') === 'valid';
|
||||
gURLBar.setPageProxyState('invalid', false);
|
||||
gURLBar.setAttribute('had-proxystate', hadValid);
|
||||
}, 0);
|
||||
},
|
||||
|
||||
onUrlbarClose() {
|
||||
if (!gURLBar.valueIsTyped && gURLBar._untrimmedValue !== gURLBar.value) {
|
||||
gURLBar.handleRevert();
|
||||
if (gURLBar.getAttribute('had-proxystate') == 'true') {
|
||||
gURLBar.setPageProxyState('valid', false);
|
||||
}
|
||||
gURLBar.removeAttribute('had-proxystate');
|
||||
},
|
||||
|
||||
onUrlbarSearchModeChanged(event) {
|
||||
|
||||
@@ -339,6 +339,11 @@ body > #confetti {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 6px;
|
||||
|
||||
@media not (-moz-platform: macos) {
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
transition:
|
||||
background-color 0.1s ease-in-out,
|
||||
transform 0.12s ease-in-out;
|
||||
@@ -498,6 +503,10 @@ body > #confetti {
|
||||
padding: 8px;
|
||||
padding-bottom: 0;
|
||||
|
||||
:root[zen-single-toolbar='true']:not([zen-right-side='true']) & {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
& toolbarbutton {
|
||||
margin: 0;
|
||||
appearance: none;
|
||||
@@ -544,7 +553,7 @@ body > #confetti {
|
||||
}
|
||||
|
||||
@media not (-moz-platform: macos) {
|
||||
border-radius: 6px;
|
||||
border-radius: 4px;
|
||||
background-color: color-mix(in srgb, currentcolor 6%, transparent);
|
||||
}
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@
|
||||
{
|
||||
duration: 0.3,
|
||||
type: 'spring',
|
||||
delay: 0.15,
|
||||
delay: 0.2,
|
||||
bounce: 0,
|
||||
}
|
||||
);
|
||||
@@ -434,6 +434,16 @@
|
||||
};
|
||||
}
|
||||
|
||||
#createGlancePreviewElement(src) {
|
||||
const imageDataElement = document.createXULElement('image');
|
||||
imageDataElement.setAttribute('src', src);
|
||||
|
||||
const parent = document.createElement('div');
|
||||
parent.classList.add('zen-glance-element-preview');
|
||||
parent.appendChild(imageDataElement);
|
||||
return parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle element preview if provided
|
||||
* @param {Object} data - Glance data
|
||||
@@ -444,10 +454,7 @@
|
||||
return null;
|
||||
}
|
||||
|
||||
const imageDataElement = document.createXULElement('image');
|
||||
imageDataElement.setAttribute('src', data.elementData);
|
||||
imageDataElement.classList.add('zen-glance-element-preview');
|
||||
|
||||
const imageDataElement = this.#createGlancePreviewElement(data.elementData);
|
||||
this.browserWrapper.prepend(imageDataElement);
|
||||
this.#glances.get(this.#currentGlanceID).elementImageData = data.elementData;
|
||||
|
||||
@@ -990,10 +997,7 @@
|
||||
*/
|
||||
#addElementPreview(elementImageData) {
|
||||
if (elementImageData) {
|
||||
const imageDataElement = document.createXULElement('image');
|
||||
imageDataElement.setAttribute('src', elementImageData);
|
||||
imageDataElement.classList.add('zen-glance-element-preview');
|
||||
|
||||
const imageDataElement = this.#createGlancePreviewElement(elementImageData);
|
||||
this.browserWrapper.prepend(imageDataElement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,11 +171,17 @@
|
||||
position: absolute;
|
||||
pointer-events: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 0;
|
||||
border-radius: var(--zen-native-inner-radius);
|
||||
top: 0%;
|
||||
left: 50%;
|
||||
translate: -50% 0%;
|
||||
max-height: 100%;
|
||||
will-change: transform, opacity;
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
|
||||
& image {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -624,13 +624,6 @@ export class nsZenSiteDataPanel {
|
||||
callout_attachment: 'topleft',
|
||||
},
|
||||
},
|
||||
{
|
||||
selector: '#identity-icon-box',
|
||||
panel_position: {
|
||||
anchor_attachment: 'bottomcenter',
|
||||
callout_attachment: 'topleft',
|
||||
},
|
||||
},
|
||||
],
|
||||
content: {
|
||||
position: 'callout',
|
||||
|
||||
Reference in New Issue
Block a user