Skip to content

Commit b932558

Browse files
committed
fix: Fixed compact mode not working at startup and finished workspace creation form, b=no-bug, c=compact-mode, workspaces
1 parent 376c64c commit b932558

File tree

4 files changed

+77
-27
lines changed

4 files changed

+77
-27
lines changed

src/zen/compact-mode/ZenCompactMode.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ var gZenCompactModeManager = {
3636
preInit() {
3737
// Remove it before initializing so we can properly calculate the width
3838
// of the sidebar at startup and avoid overflowing items not being hidden
39-
const isCompactMode =
40-
lazyCompactMode.mainAppWrapper.getAttribute('zen-compact-mode') === 'true';
39+
this._wasInCompactMode = Services.xulStore.getValue(
40+
AppConstants.BROWSER_CHROME_URL,
41+
'zen-main-app-wrapper',
42+
'zen-compact-mode'
43+
);
4144
lazyCompactMode.mainAppWrapper.removeAttribute('zen-compact-mode');
42-
this._wasInCompactMode = isCompactMode;
4345

4446
this.addContextMenu();
4547
},

src/zen/workspaces/ZenGradientGenerator.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@
7676
}
7777

7878
openThemePicker(event) {
79-
const position = event.explicitOriginalTarget?.classList?.contains(
79+
const fromForm = event.explicitOriginalTarget?.classList?.contains(
8080
'zen-workspace-creation-edit-theme-button'
81-
)
82-
? 'end_before'
83-
: 'topright topleft';
81+
);
82+
const position = fromForm ? 'bottomleft bottomright' : 'topright topleft';
8483
PanelMultiView.openPopup(this.panel, this.toolbox, {
8584
position,
8685
triggerEvent: event,
86+
y: fromForm ? -160 : 0,
8787
});
8888
}
8989

src/zen/workspaces/ZenWorkspaceCreation.mjs

Lines changed: 67 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@
4545
<menupopup class="zen-workspace-creation-profiles-popup" />
4646
</vbox>
4747
<vbox class="zen-workspace-creation-buttons">
48-
<button class="zen-workspace-creation-create-button footer-button primary"
48+
<html:div>
49+
<button class="zen-workspace-creation-create-button footer-button primary"
4950
data-l10n-id="zen-panel-ui-workspaces-create" disabled="true" />
51+
</html:div>
5052
<button class="zen-workspace-creation-cancel-button footer-button"
5153
data-l10n-id="zen-general-cancel-label" />
5254
</vbox>
@@ -66,7 +68,7 @@
6668
this.querySelector('.zen-workspace-creation-name-wrapper'),
6769
this.querySelector('.zen-workspace-creation-profile-wrapper'),
6870
this.querySelector('.zen-workspace-creation-edit-theme-button'),
69-
this.createButton,
71+
this.createButton.parentNode,
7072
this.cancelButton,
7173
];
7274
}
@@ -113,11 +115,6 @@
113115
}
114116
}
115117

116-
gBrowser.tabContainer.style.visibility = 'collapse';
117-
if (gZenVerticalTabsManager._hasSetSingleToolbar) {
118-
document.getElementById('nav-bar').style.visibility = 'collapse';
119-
}
120-
121118
for (const element of ZenWorkspaceCreation.elementsToDisable) {
122119
const el = document.getElementById(element);
123120
if (el) {
@@ -149,19 +146,42 @@
149146
this.inputProfile.parentNode.hidden = true;
150147
}
151148

152-
gZenUIManager.motion.animate(
153-
this.elementsToAnimate,
154-
{
155-
y: [20, 0],
156-
opacity: [0, 1],
157-
},
158-
{
159-
duration: 0.9,
160-
type: 'spring',
161-
bounce: 0,
162-
delay: gZenUIManager.motion.stagger(0.05, { startDelay: 0.2 }),
163-
}
164-
);
149+
gZenUIManager.motion
150+
.animate(
151+
[
152+
gBrowser.tabContainer,
153+
...(gZenVerticalTabsManager._hasSetSingleToolbar
154+
? [document.getElementById('nav-bar')]
155+
: []),
156+
],
157+
{
158+
opacity: [1, 0],
159+
},
160+
{
161+
duration: 0.3,
162+
type: 'spring',
163+
bounce: 0,
164+
}
165+
)
166+
.then(() => {
167+
gBrowser.tabContainer.style.visibility = 'collapse';
168+
if (gZenVerticalTabsManager._hasSetSingleToolbar) {
169+
document.getElementById('nav-bar').style.visibility = 'collapse';
170+
}
171+
gZenUIManager.motion.animate(
172+
this.elementsToAnimate,
173+
{
174+
y: [20, 0],
175+
opacity: [0, 1],
176+
},
177+
{
178+
duration: 0.9,
179+
type: 'spring',
180+
bounce: 0,
181+
delay: gZenUIManager.motion.stagger(0.05, { startDelay: 0.2 }),
182+
}
183+
);
184+
});
165185

166186
this.resolveInitialized();
167187
}
@@ -272,8 +292,35 @@
272292
document.documentElement.removeAttribute('zen-creating-workspace');
273293

274294
gBrowser.tabContainer.style.visibility = '';
295+
gBrowser.tabContainer.style.opacity = 0;
275296
if (gZenVerticalTabsManager._hasSetSingleToolbar) {
276297
document.getElementById('nav-bar').style.visibility = '';
298+
document.getElementById('nav-bar').style.opacity = 0;
299+
}
300+
301+
const workspace = await gZenWorkspaces.getActiveWorkspace();
302+
await gZenWorkspaces._organizeWorkspaceStripLocations(workspace, true);
303+
await gZenWorkspaces.updateTabsContainers();
304+
305+
await gZenUIManager.motion.animate(
306+
[
307+
gBrowser.tabContainer,
308+
...(gZenVerticalTabsManager._hasSetSingleToolbar
309+
? [document.getElementById('nav-bar')]
310+
: []),
311+
],
312+
{
313+
opacity: [0, 1],
314+
},
315+
{
316+
duration: 0.3,
317+
type: 'spring',
318+
bounce: 0,
319+
}
320+
);
321+
gBrowser.tabContainer.style.opacity = '';
322+
if (gZenVerticalTabsManager._hasSetSingleToolbar) {
323+
document.getElementById('nav-bar').style.opacity = '';
277324
}
278325

279326
for (const element of this.#hiddenElements) {

src/zen/workspaces/create-workspace-form.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ zen-workspace-creation {
134134
& .zen-workspace-creation-create-button {
135135
color: var(--button-text-color-primary) !important;
136136
background: var(--color-accent-primary) !important;
137+
width: 100%;
137138
}
138139
}
139140
}

0 commit comments

Comments
 (0)