mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-15 06:16:14 +00:00
feat: Added new workspace creation form, b=no-bug, c=tabs, common, compact-mode, workspaces
This commit is contained in:
@@ -6,7 +6,7 @@ export var ZenCustomizableUI = new (class {
|
||||
constructor() {}
|
||||
|
||||
TYPE_TOOLBAR = 'toolbar';
|
||||
defaultSidebarIcons = ['preferences-button', 'zen-workspaces-button', 'downloads-button'];
|
||||
defaultSidebarIcons = ['downloads-button', 'zen-workspaces-button', 'zen-create-new-button'];
|
||||
|
||||
startup(CustomizableUIInternal) {
|
||||
CustomizableUIInternal.registerArea(
|
||||
@@ -100,9 +100,34 @@ export var ZenCustomizableUI = new (class {
|
||||
elem.setAttribute('removable', 'true');
|
||||
}
|
||||
|
||||
this._initCreateNewButton(window);
|
||||
this._moveWindowButtons(window);
|
||||
}
|
||||
|
||||
_initCreateNewButton(window) {
|
||||
const button = window.document.getElementById('zen-create-new-button');
|
||||
button.addEventListener('command', () => {
|
||||
const image = button.querySelector('image');
|
||||
const popup = window.document.getElementById('zenCreateNewPopup');
|
||||
button.setAttribute('open', 'true');
|
||||
const handlePopupHidden = () => {
|
||||
button.removeAttribute('open');
|
||||
window.gZenUIManager.motion.animate(
|
||||
image,
|
||||
{ transform: ['rotate(45deg)', 'rotate(0deg)'] },
|
||||
{ duration: 0.2 }
|
||||
);
|
||||
};
|
||||
popup.addEventListener('popuphidden', handlePopupHidden, { once: true });
|
||||
popup.openPopup(button, 'after_start');
|
||||
window.gZenUIManager.motion.animate(
|
||||
image,
|
||||
{ transform: ['rotate(0deg)', 'rotate(45deg)'] },
|
||||
{ duration: 0.2 }
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
_moveWindowButtons(window) {
|
||||
const windowControls = window.document.getElementsByClassName('titlebar-buttonbox-container');
|
||||
const toolboxIcons = window.document.getElementById(
|
||||
|
Reference in New Issue
Block a user