Skip to content

Commit

Permalink
Refactor Zen UI components for improved toolbar button management and…
Browse files Browse the repository at this point in the history
… layout adjustments
  • Loading branch information
mauro-balades committed Jan 17, 2025
1 parent 9fb04e4 commit ee86bff
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
4 changes: 1 addition & 3 deletions src/browser/base/content/ZenCustomizableUI.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export var ZenCustomizableUI = new (class {
'zen-sidebar-top-buttons',
{
type: this.TYPE_TOOLBAR,
defaultPlacements: [],
defaultPlacements: [''],
defaultCollapsed: null,
},
true
Expand Down Expand Up @@ -47,8 +47,6 @@ export var ZenCustomizableUI = new (class {
customizationtarget="zen-sidebar-top-buttons-customization-target"
mode="icons">
<hbox id="zen-sidebar-top-buttons-customization-target" class="customization-target" flex="1">
<toolbarbutton removable="true" class="chromeclass-toolbar-additional toolbarbutton-1 zen-sidebar-action-button" id="zen-expand-sidebar-button" data-l10n-id="sidebar-zen-expand" cui-areatype="toolbar" oncommand="gZenVerticalTabsManager.toggleExpand();"></toolbarbutton>
<toolbarbutton removable="true" class="toolbarbutton-1 zen-sidebar-action-button zen-compact-mode-ignore" id="zen-sidepanel-button" data-l10n-id="sidebar-zen-sidepanel" onclick="gZenBrowserManagerSidebar.toggle();"></toolbarbutton>
</hbox>
</toolbar>
`);
Expand Down
2 changes: 1 addition & 1 deletion src/browser/base/content/ZenStartup.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
}

// remove all styles except for the width, since we are xulstoring the complet style list
const width = toolbox.style.width || '270px';
const width = toolbox.style.width || '180px';
toolbox.removeAttribute('style');
toolbox.style.width = width;

Expand Down
5 changes: 4 additions & 1 deletion src/browser/base/content/zen-sidebar-icons.inc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
skipintoolbarset="true"
context="toolbar-context-menu"
mode="icons">
<toolbarbutton removable="true" class="chromeclass-toolbar-additional toolbarbutton-1 zen-sidebar-action-button" id="zen-expand-sidebar-button" data-l10n-id="sidebar-zen-expand" cui-areatype="toolbar" oncommand="gZenVerticalTabsManager.toggleExpand();"></toolbarbutton>
<toolbarbutton removable="true" class="toolbarbutton-1 zen-sidebar-action-button zen-compact-mode-ignore" id="zen-sidepanel-button" data-l10n-id="sidebar-zen-sidepanel" onclick="gZenBrowserManagerSidebar.toggle();"></toolbarbutton>
<toolbarbutton removable="true" id="zen-workspaces-button"></toolbarbutton>
<toolbarbutton id="zen-profile-button"
class="zen-sidebar-action-button toolbarbutton-1 chromeclass-toolbar-additional"
delegatesanchor="true"
Expand All @@ -22,4 +25,4 @@
<image id="zen-profile-button-icon" />
</vbox>
</toolbarbutton>
</toolbar>
</toolbar>
2 changes: 1 addition & 1 deletion src/browser/base/content/zen-styles/zen-urlbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
}

:root[zen-single-toolbar='true'] {
.urlbar-page-action:not(#star-button-box):not([open]),
.urlbar-page-action:not([open]),
#tracking-protection-icon-container {
margin-inline-end: calc(-16px - 2 * var(--urlbar-icon-padding)) !important;
opacity: 0;
Expand Down
7 changes: 0 additions & 7 deletions src/browser/base/zen-components/ZenWorkspaces.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,13 +1056,6 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
let button = browser.document.getElementById('zen-workspaces-button');

if (!button) {
button = browser.document.createXULElement('toolbarbutton');
button.id = 'zen-workspaces-button';
let navbar = browser.document.getElementById('nav-bar');
navbar.appendChild(button);
}

while (button.firstChild) {
button.firstChild.remove();
}
Expand Down

0 comments on commit ee86bff

Please sign in to comment.