mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-08 17:39:59 +02:00
91 lines
3.7 KiB
C++
91 lines
3.7 KiB
C++
diff --git a/browser/components/tabbrowser/content/tab.js b/browser/components/tabbrowser/content/tab.js
|
|
index d41c486c02a6f09dcff5741a59ad8b617294c481..8e902dcb3792c75238ac13a8bf9199b34451aa51 100644
|
|
--- a/browser/components/tabbrowser/content/tab.js
|
|
+++ b/browser/components/tabbrowser/content/tab.js
|
|
@@ -16,6 +16,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"/>
|
|
@@ -35,8 +36,10 @@
|
|
<label class="tab-icon-sound-label tab-icon-sound-pip-label" data-l10n-id="browser-tab-audio-pip" role="presentation"/>
|
|
<label class="tab-icon-sound-label tab-icon-sound-tooltip-label" 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>
|
|
`;
|
|
@@ -168,7 +171,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;
|
|
}
|
|
|
|
@@ -204,7 +207,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() {
|
|
@@ -266,7 +269,7 @@
|
|
return false;
|
|
}
|
|
|
|
- return true;
|
|
+ return !this.hasAttribute("zen-empty-tab");
|
|
}
|
|
|
|
get lastAccessed() {
|
|
@@ -451,6 +454,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")
|
|
) {
|
|
eventMaySelectTab = false;
|
|
@@ -544,6 +549,7 @@
|
|
if (this.multiselected) {
|
|
gBrowser.removeMultiSelectedTabs();
|
|
} else {
|
|
+ gZenPinnedTabManager._removePinnedAttributes(this, true);
|
|
gBrowser.removeTab(this, {
|
|
animate: true,
|
|
triggeringEvent: event,
|
|
@@ -553,6 +559,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) {
|
|
@@ -576,6 +590,8 @@
|
|
animate: true,
|
|
triggeringEvent: event,
|
|
});
|
|
+ } else if (this.hasAttribute('zen-essential') && !event.target.classList.contains("tab-icon-overlay")) {
|
|
+ gZenPinnedTabManager._onTabResetPinButton(event, this, 'reset');
|
|
}
|
|
}
|
|
|