mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-08 04:49:59 +02:00
feat: Improved workspace creation animations, b=no-bug, c=workspaces
This commit is contained in:
parent
289e84b75d
commit
ce75bc152a
4 changed files with 18 additions and 12 deletions
|
@ -86,8 +86,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.documentElement.setAttribute('zen-creating-workspace', 'true');
|
|
||||||
|
|
||||||
this.appendChild(this.constructor.fragment);
|
this.appendChild(this.constructor.fragment);
|
||||||
this.initializeAttributeInheritance();
|
this.initializeAttributeInheritance();
|
||||||
|
|
||||||
|
@ -177,6 +175,7 @@
|
||||||
{
|
{
|
||||||
y: [20, 0],
|
y: [20, 0],
|
||||||
opacity: [0, 1],
|
opacity: [0, 1],
|
||||||
|
filter: ['blur(2px)', 'blur(0)'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
duration: 0.6,
|
duration: 0.6,
|
||||||
|
@ -197,16 +196,16 @@
|
||||||
workspace.containerTabId = this.currentProfile;
|
workspace.containerTabId = this.currentProfile;
|
||||||
await gZenWorkspaces.saveWorkspace(workspace);
|
await gZenWorkspaces.saveWorkspace(workspace);
|
||||||
|
|
||||||
|
if (gZenVerticalTabsManager._canReplaceNewTab) {
|
||||||
|
BrowserCommands.openTab();
|
||||||
|
}
|
||||||
|
|
||||||
await this.#cleanup();
|
await this.#cleanup();
|
||||||
|
|
||||||
await gZenWorkspaces._organizeWorkspaceStripLocations(workspace, true);
|
await gZenWorkspaces._organizeWorkspaceStripLocations(workspace, true);
|
||||||
await gZenWorkspaces.updateTabsContainers();
|
await gZenWorkspaces.updateTabsContainers();
|
||||||
|
|
||||||
gBrowser.tabContainer._invalidateCachedTabs();
|
gBrowser.tabContainer._invalidateCachedTabs();
|
||||||
|
|
||||||
if (gZenVerticalTabsManager._canReplaceNewTab) {
|
|
||||||
BrowserCommands.openTab();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async onCancelButtonCommand() {
|
async onCancelButtonCommand() {
|
||||||
|
@ -270,6 +269,7 @@
|
||||||
{
|
{
|
||||||
y: [0, 20],
|
y: [0, 20],
|
||||||
opacity: [1, 0],
|
opacity: [1, 0],
|
||||||
|
filter: ['blur(0)', 'blur(2px)'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
duration: 0.4,
|
duration: 0.4,
|
||||||
|
|
|
@ -1296,9 +1296,10 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||||
await this._propagateWorkspaceData();
|
await this._propagateWorkspaceData();
|
||||||
}
|
}
|
||||||
|
|
||||||
async openWorkspaceCreation(event) {
|
async openWorkspaceCreation() {
|
||||||
let createForm;
|
let createForm;
|
||||||
const previousWorkspace = await this.getActiveWorkspace();
|
const previousWorkspace = await this.getActiveWorkspace();
|
||||||
|
document.documentElement.setAttribute('zen-creating-workspace', 'true');
|
||||||
await this.createAndSaveWorkspace('Space', undefined, false, 0, {
|
await this.createAndSaveWorkspace('Space', undefined, false, 0, {
|
||||||
beforeChangeCallback: async (workspace) => {
|
beforeChangeCallback: async (workspace) => {
|
||||||
createForm = document.createXULElement('zen-workspace-creation');
|
createForm = document.createXULElement('zen-workspace-creation');
|
||||||
|
@ -2180,7 +2181,11 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||||
}
|
}
|
||||||
|
|
||||||
async onPinnedTabsResize(entries, forAnimation = false, animateContainer = false) {
|
async onPinnedTabsResize(entries, forAnimation = false, animateContainer = false) {
|
||||||
if (!this._hasInitializedTabsStrip || (this._organizingWorkspaceStrip && !forAnimation)) {
|
if (
|
||||||
|
!this._hasInitializedTabsStrip ||
|
||||||
|
(this._organizingWorkspaceStrip && !forAnimation) ||
|
||||||
|
document.documentElement.hasAttribute('zen-creating-workspace')
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (document.documentElement.hasAttribute('customizing')) return;
|
if (document.documentElement.hasAttribute('customizing')) return;
|
||||||
|
|
|
@ -32,8 +32,8 @@ zen-workspace-creation {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: calc(100% - 10px);
|
width: calc(100% - 10px);
|
||||||
margin: auto;
|
margin: auto;
|
||||||
gap: 2.2rem;
|
gap: 3.2rem;
|
||||||
margin-top: 2.2rem;
|
margin-top: 1.2rem;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
& .zen-workspace-creation-form {
|
& .zen-workspace-creation-form {
|
||||||
|
|
|
@ -62,7 +62,8 @@
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover,
|
||||||
|
&[dragged='true']{
|
||||||
background-color: var(--zen-toolbar-element-bg);
|
background-color: var(--zen-toolbar-element-bg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +91,7 @@
|
||||||
%include overflow-icons.inc.css
|
%include overflow-icons.inc.css
|
||||||
}
|
}
|
||||||
|
|
||||||
&:has(toolbarbutton:hover) toolbarbutton[active='true'] {
|
&:has(toolbarbutton:hover) toolbarbutton[active='true']:not([dragged='true']) {
|
||||||
%include overflow-icons.inc.css
|
%include overflow-icons.inc.css
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue