mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-07 20:39:59 +02:00
102 lines
3.8 KiB
C++
102 lines
3.8 KiB
C++
diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js
|
|
index 793ba822f087f4d198c9876ed208ff16d8a41e3b..e53ccd748de015997c355d5d37cb38cc73e90f3d 100644
|
|
--- a/browser/components/tabbrowser/content/tab.js
|
|
+++ b/browser/components/tabbrowser/content/tab.js
|
|
@@ -21,6 +21,7 @@
|
|
<hbox class="tab-group-line"/>
|
|
</vbox>
|
|
<hbox class="tab-content" align="center">
|
|
+ <box class="tab-reset-pin-button" role="button" data-l10n-id="tabbrowser-reset-pin-button" data-l10n-args='{"tabCount": 1}' keyNav="false"><image/></box>
|
|
<stack class="tab-icon-stack">
|
|
<hbox class="tab-throbber"/>
|
|
<hbox class="tab-icon-pending"/>
|
|
@@ -37,8 +38,10 @@
|
|
<hbox class="tab-secondary-label">
|
|
<label class="tab-icon-sound-label tab-icon-sound-pip-label" data-l10n-id="browser-tab-audio-pip" role="presentation"/>
|
|
</hbox>
|
|
+ <label class="tab-reset-pin-label" data-l10n-id="tab-reset-pin-label" role="presentation"/>
|
|
</vbox>
|
|
<image class="tab-close-button close-icon" role="button" data-l10n-id="tabbrowser-close-tabs-button" data-l10n-args='{"tabCount": 1}' keyNav="false"/>
|
|
+ <image class="tab-reset-button reset-icon" role="button" data-l10n-id="tabbrowser-unload-tab-button" data-l10n-args='{"tabCount": 1}' keyNav="false"/>
|
|
</hbox>
|
|
</stack>
|
|
`;
|
|
@@ -180,7 +183,7 @@
|
|
}
|
|
|
|
set _visuallySelected(val) {
|
|
- if (val == this.hasAttribute("visuallyselected")) {
|
|
+ if (val == this.hasAttribute("visuallyselected") || (!val && this.linkedBrowser?.closest('.browserSidebarContainer').classList.contains('zen-glance-background'))) {
|
|
return;
|
|
}
|
|
|
|
@@ -216,7 +219,7 @@
|
|
}
|
|
|
|
get visible() {
|
|
- return this.isOpen && !this.hidden && !this.group?.collapsed;
|
|
+ return this.isOpen && !this.hidden && !this.group?.collapsed && !this.hasAttribute("zen-empty-tab");
|
|
}
|
|
|
|
get hidden() {
|
|
@@ -287,7 +290,7 @@
|
|
return false;
|
|
}
|
|
|
|
- return true;
|
|
+ return !this.hasAttribute("zen-empty-tab");
|
|
}
|
|
|
|
get lastAccessed() {
|
|
@@ -459,6 +462,8 @@
|
|
this.style.MozUserFocus = "ignore";
|
|
} else if (
|
|
event.target.classList.contains("tab-close-button") ||
|
|
+ event.target.classList.contains("tab-reset-button") ||
|
|
+ event.target.classList.contains("tab-reset-pin-button") ||
|
|
event.target.classList.contains("tab-icon-overlay") ||
|
|
event.target.classList.contains("tab-audio-button")
|
|
) {
|
|
@@ -513,6 +518,10 @@
|
|
this.style.MozUserFocus = "";
|
|
}
|
|
|
|
+ get glanceTab() {
|
|
+ return this.querySelector("tab[zen-glance-tab]");
|
|
+ }
|
|
+
|
|
on_click(event) {
|
|
if (event.button != 0) {
|
|
return;
|
|
@@ -561,6 +570,7 @@
|
|
)
|
|
);
|
|
} else {
|
|
+ gZenPinnedTabManager._removePinnedAttributes(this, true);
|
|
gBrowser.removeTab(this, {
|
|
animate: true,
|
|
triggeringEvent: event,
|
|
@@ -573,6 +583,14 @@
|
|
// (see tabbrowser-tabs 'click' handler).
|
|
gBrowser.tabContainer._blockDblClick = true;
|
|
}
|
|
+
|
|
+ if (event.target.classList.contains("tab-reset-pin-button")) {
|
|
+ gZenPinnedTabManager._onTabResetPinButton(event, this, 'reset');
|
|
+ gBrowser.tabContainer._blockDblClick = true;
|
|
+ } else if (event.target.classList.contains("tab-reset-button")) {
|
|
+ gZenPinnedTabManager._onCloseTabShortcut(event, this);
|
|
+ gBrowser.tabContainer._blockDblClick = true;
|
|
+ }
|
|
}
|
|
|
|
on_dblclick(event) {
|
|
@@ -596,6 +614,8 @@
|
|
animate: true,
|
|
triggeringEvent: event,
|
|
});
|
|
+ } else if (this.hasAttribute('zen-essential') && !event.target.classList.contains("tab-icon-overlay")) {
|
|
+ gZenPinnedTabManager._onTabResetPinButton(event, this, 'reset');
|
|
}
|
|
}
|
|
|