mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Merge pull request #2583 from kristijanribaric/feature/essentials
Feature: Essentials
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
||||
diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js
|
||||
index 6992d22069643b58b249ae16edfe354304e56a39..38a006799feb5f4f41e582074901bb7226397ae1 100644
|
||||
index 62b3665394a8256ebedf88a8f10bb6766977cf57..a0bee37cbf9e8f79b3ea69b8dec711a93ef837a0 100644
|
||||
--- a/browser/base/content/browser-places.js
|
||||
+++ b/browser/base/content/browser-places.js
|
||||
@@ -243,6 +243,8 @@ var StarUI = {
|
||||
@@ -252,6 +252,8 @@ var StarUI = {
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ index 6992d22069643b58b249ae16edfe354304e56a39..38a006799feb5f4f41e582074901bb72
|
||||
let onPanelReady = fn => {
|
||||
let target = this.panel;
|
||||
if (target.parentNode) {
|
||||
@@ -294,6 +296,21 @@ var StarUI = {
|
||||
@@ -303,6 +305,21 @@ var StarUI = {
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33,3 +33,16 @@ index 6992d22069643b58b249ae16edfe354304e56a39..38a006799feb5f4f41e582074901bb72
|
||||
removeBookmarkButtonCommand: function SU_removeBookmarkButtonCommand() {
|
||||
this._removeBookmarksOnPopupHidden = true;
|
||||
this.panel.hidePopup();
|
||||
@@ -1107,6 +1124,12 @@ var PlacesToolbarHelper = {
|
||||
viewElt
|
||||
);
|
||||
|
||||
+ new ZenEssentialsToolbar(
|
||||
+ `place:parent=pfgqteRgY-Wr`,
|
||||
+ document.getElementById("EssentialsToolbarItems"),
|
||||
+ document.getElementById("EssentialsToolbar")
|
||||
+ );
|
||||
+
|
||||
if (toolbar.id == "PersonalToolbar") {
|
||||
// We just created a new view, thus we must check again the empty toolbar
|
||||
// message, regardless of "initialized".
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git a/browser/base/content/navigator-toolbox.inc.xhtml b/browser/base/content/navigator-toolbox.inc.xhtml
|
||||
index 12fa0cf79aade28581016adf96df85386dabdcef..4c8c2f791b29da0308d1a24778c1e7f5a9bb7293 100644
|
||||
index 12fa0cf79aade28581016adf96df85386dabdcef..b2a29b4c9a61ee8380076a0bcc517f3cf217528a 100644
|
||||
--- a/browser/base/content/navigator-toolbox.inc.xhtml
|
||||
+++ b/browser/base/content/navigator-toolbox.inc.xhtml
|
||||
@@ -2,7 +2,7 @@
|
||||
@@ -36,16 +36,40 @@ index 12fa0cf79aade28581016adf96df85386dabdcef..4c8c2f791b29da0308d1a24778c1e7f5
|
||||
stopwatchid="FX_TAB_CLICK_MS">
|
||||
<hbox class="tab-drop-indicator" hidden="true"/>
|
||||
# If the name (tabbrowser-arrowscrollbox) or structure of this changes
|
||||
@@ -59,7 +60,7 @@
|
||||
@@ -58,8 +59,31 @@
|
||||
# DisplayPortUtils::MaybeCreateDisplayPortInFirstScrollFrameEncountered based
|
||||
# the current structure that we may want to revisit.
|
||||
<html:div id="vertical-pinned-tabs-container"></html:div>
|
||||
+ <toolbarbutton id="essentials-accordion-header" oncommand="gZenBrowserManagerSidebar.toggleEssentialsAccordion(this)">
|
||||
+ Essentials
|
||||
+ <toolbarbutton id="essentials-accordion-icon">
|
||||
+ <image></image>
|
||||
+ </toolbarbutton>
|
||||
+ <html:div class="accordion-header-line"></html:div>
|
||||
+ </toolbarbutton>
|
||||
+ <hbox
|
||||
+ id="EssentialsToolbar"
|
||||
+ context="placesContext"
|
||||
+ onmouseup="BookmarksEventHandler.onMouseUp(event);"
|
||||
+ onclick="BookmarksEventHandler.onClick(event, this._placesView);"
|
||||
+ oncommand="BookmarksEventHandler.onCommand(event);"
|
||||
+ tooltip="bhTooltip"
|
||||
+ popupsinherittooltip="true">
|
||||
+ <hbox id="EssentialsToolbarDropIndicatorHolder" align="center" collapsed="true">
|
||||
+ <image id="EssentialsToolbarDropIndicator"
|
||||
+ collapsed="true"/>
|
||||
+ </hbox>
|
||||
+ <scrollbox orient="vertical"
|
||||
+ id="EssentialsToolbarItems"
|
||||
+ flex="1"/>
|
||||
+ </hbox>
|
||||
<html:div id="vertical-pinned-tabs-container-separator"></html:div>
|
||||
- <arrowscrollbox id="tabbrowser-arrowscrollbox" orient="horizontal" flex="1" clicktoscroll="" scrolledtostart="" scrolledtoend="">
|
||||
+ <arrowscrollbox id="tabbrowser-arrowscrollbox" orient="vertical" flex="1" clicktoscroll="" scrolledtostart="" scrolledtoend="">
|
||||
<tab is="tabbrowser-tab" class="tabbrowser-tab" selected="true" visuallyselected="" fadein=""/>
|
||||
<hbox id="tabbrowser-arrowscrollbox-periphery">
|
||||
<toolbartabstop/>
|
||||
@@ -113,9 +114,10 @@
|
||||
@@ -113,9 +137,10 @@
|
||||
<toolbarbutton id="content-analysis-indicator"
|
||||
oncommand="ContentAnalysis.showPanel(this, PanelUI);"
|
||||
class="toolbarbutton-1 content-analysis-indicator-icon"/>
|
||||
@@ -58,7 +82,7 @@ index 12fa0cf79aade28581016adf96df85386dabdcef..4c8c2f791b29da0308d1a24778c1e7f5
|
||||
</toolbar>
|
||||
|
||||
</vbox>
|
||||
@@ -531,6 +534,7 @@
|
||||
@@ -531,6 +556,7 @@
|
||||
consumeanchor="PanelUI-button"
|
||||
data-l10n-id="appmenu-menu-button-closed2"/>
|
||||
</toolbaritem>
|
||||
|
@@ -34,6 +34,7 @@
|
||||
<script src="chrome://browser/content/ZenUIManager.mjs" />
|
||||
<script src="chrome://browser/content/zen-components/ZenSidebarManager.mjs"/>
|
||||
<script src="chrome://browser/content/zen-components/ZenTabUnloader.mjs" />
|
||||
<script src="chrome://browser/content/zen-components/ZenEssentialsToolbar.mjs" />
|
||||
<script src="chrome://browser/content/zen-components/ZenWorkspaces.mjs" />
|
||||
<script src="chrome://browser/content/zen-components/ZenWorkspacesStorage.mjs" />
|
||||
<script src="chrome://browser/content/zen-components/ZenWorkspacesSync.mjs" />
|
||||
|
@@ -16,6 +16,7 @@
|
||||
content/browser/zen-components/ZenThemeBuilder.mjs (content/zen-components/src/ZenThemeBuilder.mjs)
|
||||
content/browser/zen-components/ZenThemesImporter.mjs (content/zen-components/src/ZenThemesImporter.mjs)
|
||||
content/browser/zen-components/ZenTabUnloader.mjs (content/zen-components/src/ZenTabUnloader.mjs)
|
||||
content/browser/zen-components/ZenEssentialsToolbar.mjs (content/zen-components/src/ZenEssentialsToolbar.mjs)
|
||||
content/browser/zen-components/ZenPinnedTabManager.mjs (content/zen-components/src/ZenPinnedTabManager.mjs)
|
||||
content/browser/zen-components/ZenCommonUtils.mjs (content/zen-components/src/ZenCommonUtils.mjs)
|
||||
content/browser/zen-components/ZenGradientGenerator.mjs (content/zen-components/src/ZenGradientGenerator.mjs)
|
||||
|
@@ -73,3 +73,78 @@
|
||||
#toolbar-menubar {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Essentials styles */
|
||||
#EssentialsToolbar {
|
||||
border-bottom: 1px solid var(--zen-colors-border);
|
||||
padding-bottom: 6px;
|
||||
& .bookmark-item {
|
||||
max-width: unset;
|
||||
padding: 8px;
|
||||
gap: 8px;
|
||||
|
||||
& .toolbarbutton-icon {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
}
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#essentials-accordion-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
background: none !important;
|
||||
border: none !important;
|
||||
appearance: unset !important;
|
||||
padding: 4px 8px;
|
||||
gap: 6px;
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
transition: 0.3s;
|
||||
}
|
||||
|
||||
.accordion-header-line {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
width: 100%;
|
||||
background-color: currentColor;
|
||||
}
|
||||
|
||||
#essentials-accordion-header[expanded] #essentials-accordion-icon image {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
#essentials-accordion-icon {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
appearance: none !important;
|
||||
|
||||
color:inherit !important;
|
||||
-moz-context-properties: fill, fill-opacity !important;
|
||||
fill: currentColor !important;
|
||||
& image {
|
||||
|
||||
color: inherit !important;
|
||||
list-style-image: url("chrome://global/skin/icons/chevron.svg") !important;
|
||||
transition: transform 0.3s ease;
|
||||
appearance: unset !important;
|
||||
}
|
||||
}
|
||||
|
||||
#EssentialsToolbarItems {
|
||||
max-height: 0;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.3s ease-out;
|
||||
padding: 0 4px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
#EssentialsToolbarItems[expanded] {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
#EssentialsToolbarItems .bookmark-item {
|
||||
max-width: unset;
|
||||
}
|
||||
|
@@ -254,17 +254,18 @@
|
||||
margin-bottom: 12px;
|
||||
position: relative;
|
||||
|
||||
&::after {
|
||||
bottom: -6px;
|
||||
content: '';
|
||||
display: block;
|
||||
height: 1px;
|
||||
background: light-dark(rgba(1, 1, 1, 0.075), rgba(255, 255, 255, 0.075));
|
||||
width: 99%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
position: absolute;
|
||||
}
|
||||
/*TODO: figure out if we want this line*/
|
||||
/*&::after {*/
|
||||
/* bottom: -6px;*/
|
||||
/* content: '';*/
|
||||
/* display: block;*/
|
||||
/* height: 1px;*/
|
||||
/* background: light-dark(rgba(1, 1, 1, 0.075), rgba(255, 255, 255, 0.075));*/
|
||||
/* width: 99%;*/
|
||||
/* left: 50%;*/
|
||||
/* transform: translateX(-50%);*/
|
||||
/* position: absolute;*/
|
||||
/*}*/
|
||||
|
||||
& .tabbrowser-tab {
|
||||
width: 100%;
|
||||
@@ -444,6 +445,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
& #EssentialsToolbar {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
& #essentials-accordion-header {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
& #vertical-pinned-tabs-container:has(tab:not([hidden])) {
|
||||
margin-bottom: 12px;
|
||||
position: relative;
|
||||
|
@@ -0,0 +1,30 @@
|
||||
diff --git a/browser/components/places/content/browserPlacesViews.js b/browser/components/places/content/browserPlacesViews.js
|
||||
index 1bfa0af16178c9b42172bc1b1e0249d28ff8e9e6..e7e76a6d548b32887c1d39053e42c5e3dafbb839 100644
|
||||
--- a/browser/components/places/content/browserPlacesViews.js
|
||||
+++ b/browser/components/places/content/browserPlacesViews.js
|
||||
@@ -393,6 +393,7 @@ class PlacesViewBase {
|
||||
"scheme",
|
||||
PlacesUIUtils.guessUrlSchemeForUI(aPlacesNode.uri)
|
||||
);
|
||||
+ element.addEventListener("command", gZenGlanceManager.openGlanceForBookmark.bind(gZenGlanceManager));
|
||||
} else if (PlacesUtils.containerTypes.includes(type)) {
|
||||
element = document.createXULElement("menu");
|
||||
element.setAttribute("container", "true");
|
||||
@@ -1087,6 +1088,8 @@ class PlacesToolbar extends PlacesViewBase {
|
||||
"scheme",
|
||||
PlacesUIUtils.guessUrlSchemeForUI(aChild.uri)
|
||||
);
|
||||
+ button.hidden = ZenWorkspaces.isBookmarkInAnotherWorkspace(aChild);
|
||||
+ button.addEventListener("command", gZenGlanceManager.openGlanceForBookmark.bind(gZenGlanceManager));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2235,7 +2238,7 @@ this.PlacesPanelview = class PlacesPanelview extends PlacesViewBase {
|
||||
PlacesUIUtils.guessUrlSchemeForUI(placesNode.uri)
|
||||
);
|
||||
element.setAttribute("label", PlacesUIUtils.getBestTitle(placesNode));
|
||||
-
|
||||
+ element.addEventListener("command", gZenGlanceManager.openGlanceForBookmark.bind(gZenGlanceManager));
|
||||
let icon = placesNode.icon;
|
||||
if (icon) {
|
||||
element.setAttribute("image", icon);
|
@@ -1099,5 +1099,10 @@ Preferences.addAll([
|
||||
id: "zen.view.compact.color-sidebar",
|
||||
type: "bool",
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
id: "zen.essentials.enabled",
|
||||
type: "bool",
|
||||
default: true,
|
||||
}
|
||||
]);
|
||||
|
Reference in New Issue
Block a user