feat: Add indent to preference and tweak glance animation, b=no-bug, c=glance

This commit is contained in:
mr. m
2025-10-10 00:16:23 +02:00
parent 5919dc41b9
commit 28bf0458e4
2 changed files with 19 additions and 11 deletions

View File

@@ -1,18 +1,20 @@
diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml diff --git a/browser/components/preferences/main.inc.xhtml b/browser/components/preferences/main.inc.xhtml
index 891cf7108cf4606c99a902afa420e744b9690b87..72034b4a28e68016c04d06a2991ccebff30dd341 100644 index 891cf7108cf4606c99a902afa420e744b9690b87..80a971b4a3e733e6495a0a11654c209e2aea5d9c 100644
--- a/browser/components/preferences/main.inc.xhtml --- a/browser/components/preferences/main.inc.xhtml
+++ b/browser/components/preferences/main.inc.xhtml +++ b/browser/components/preferences/main.inc.xhtml
@@ -29,6 +29,9 @@ @@ -29,6 +29,11 @@
<vbox id="startupPageBox"> <vbox id="startupPageBox">
<checkbox id="browserRestoreSession" <checkbox id="browserRestoreSession"
data-l10n-id="startup-restore-windows-and-tabs"/> data-l10n-id="startup-restore-windows-and-tabs"/>
+ <checkbox id="zenWorkspaceContinueWhereLeftOff" + <vbox id="windowsLaunchOnLoginDisabledBox" align="center" class="indent" hidden="true">
+ data-l10n-id="zen-workspace-continue-where-left-off" + <checkbox id="zenWorkspaceContinueWhereLeftOff"
+ preference="zen.workspaces.continue-where-left-off"/> + data-l10n-id="zen-workspace-continue-where-left-off"
+ preference="zen.workspaces.continue-where-left-off"/>
+ </vbox>
#ifdef XP_WIN #ifdef XP_WIN
<hbox id="windowsLaunchOnLoginBox" align="center" hidden="true"> <hbox id="windowsLaunchOnLoginBox" align="center" hidden="true">
<checkbox id="windowsLaunchOnLogin" <checkbox id="windowsLaunchOnLogin"
@@ -189,7 +192,8 @@ @@ -189,7 +194,8 @@
<!-- Browser layout --> <!-- Browser layout -->
<groupbox data-category="paneGeneral" <groupbox data-category="paneGeneral"
data-subcategory="layout" data-subcategory="layout"
@@ -22,7 +24,7 @@ index 891cf7108cf4606c99a902afa420e744b9690b87..72034b4a28e68016c04d06a2991ccebf
<label><html:h2 data-l10n-id="browser-layout-header"/></label> <label><html:h2 data-l10n-id="browser-layout-header"/></label>
<radiogroup id="browserLayoutRadioGroup" preference="sidebar.verticalTabs"> <radiogroup id="browserLayoutRadioGroup" preference="sidebar.verticalTabs">
<radio id="browserLayoutHorizontalTabs" data-l10n-id="browser-layout-horizontal-tabs" value="false"/> <radio id="browserLayoutHorizontalTabs" data-l10n-id="browser-layout-horizontal-tabs" value="false"/>
@@ -420,6 +424,7 @@ @@ -420,6 +426,7 @@
languages-customize-add.label, languages-customize-add.label,
" /> " />
</hbox> </hbox>

View File

@@ -373,9 +373,10 @@
/** /**
* Handle element preview if provided * Handle element preview if provided
* @param {Object} data - Glance data * @param {Object} data - Glance data
* @param {Object} rect - The rectangle data
* @returns {Element|null} The preview element or null * @returns {Element|null} The preview element or null
*/ */
#handleElementPreview(data) { #handleElementPreview(data, rect) {
if (!data.elementData) { if (!data.elementData) {
return null; return null;
} }
@@ -383,9 +384,11 @@
const imageDataElement = document.createXULElement('image'); const imageDataElement = document.createXULElement('image');
imageDataElement.setAttribute('src', data.elementData); imageDataElement.setAttribute('src', data.elementData);
imageDataElement.classList.add('zen-glance-element-preview'); imageDataElement.classList.add('zen-glance-element-preview');
imageDataElement.style.width = `${data.width}px`;
imageDataElement.style.height = `${data.height}px`;
this.browserWrapper.prepend(imageDataElement); this.browserWrapper.prepend(imageDataElement);
this.#glances.get(this.#currentGlanceID).elementImageData = data.elementData; this.#glances.get(this.#currentGlanceID).elementImageData = data.elementData;
return imageDataElement; return imageDataElement;
} }
@@ -834,7 +837,7 @@
const originalPosition = this.#glances.get(this.#currentGlanceID).originalPosition; const originalPosition = this.#glances.get(this.#currentGlanceID).originalPosition;
const elementImageData = this.#glances.get(this.#currentGlanceID).elementImageData; const elementImageData = this.#glances.get(this.#currentGlanceID).elementImageData;
this.#addElementPreview(elementImageData); this.#addElementPreview(elementImageData, originalPosition);
// Create curved closing animation sequence // Create curved closing animation sequence
const closingData = this.#createClosingDataFromOriginalPosition(originalPosition); const closingData = this.#createClosingDataFromOriginalPosition(originalPosition);
@@ -876,12 +879,15 @@
/** /**
* Add element preview if available * Add element preview if available
* @param {string} elementImageData - The element image data * @param {string} elementImageData - The element image data
* @param {Object} rect - The rectangle data
*/ */
#addElementPreview(elementImageData) { #addElementPreview(elementImageData, rect) {
if (elementImageData) { if (elementImageData) {
const imageDataElement = document.createXULElement('image'); const imageDataElement = document.createXULElement('image');
imageDataElement.setAttribute('src', elementImageData); imageDataElement.setAttribute('src', elementImageData);
imageDataElement.classList.add('zen-glance-element-preview'); imageDataElement.classList.add('zen-glance-element-preview');
imageDataElement.style.width = rect.width;
imageDataElement.style.height = rect.height;
this.browserWrapper.prepend(imageDataElement); this.browserWrapper.prepend(imageDataElement);
} }
} }