mirror of
https://github.com/zen-browser/desktop.git
synced 2026-06-14 07:23:42 +00:00
feat: Add preference for sidebar dragging, b=no-bug, c=common, workspaces
This commit is contained in:
@@ -57,3 +57,6 @@
|
||||
|
||||
- name: zen.view.show-clear-tabs-button
|
||||
value: true
|
||||
|
||||
- name: zen.view.draggable-sidebar
|
||||
value: true
|
||||
|
||||
15
src/browser/components/urlbar/UrlbarResult-sys-mjs.patch
Normal file
15
src/browser/components/urlbar/UrlbarResult-sys-mjs.patch
Normal file
@@ -0,0 +1,15 @@
|
||||
diff --git a/browser/components/urlbar/UrlbarResult.sys.mjs b/browser/components/urlbar/UrlbarResult.sys.mjs
|
||||
index 0882c0a01d17184cadb56aa1236ca97adf7f866b..4a5842eda6280205b96f9aee9b6f3b49fac7077c 100644
|
||||
--- a/browser/components/urlbar/UrlbarResult.sys.mjs
|
||||
+++ b/browser/components/urlbar/UrlbarResult.sys.mjs
|
||||
@@ -172,6 +172,10 @@ export class UrlbarResult {
|
||||
return this.#heuristic;
|
||||
}
|
||||
|
||||
+ set heuristic(value) {
|
||||
+ this.#heuristic = value;
|
||||
+ }
|
||||
+
|
||||
get hideRowLabel() {
|
||||
return this.#hideRowLabel;
|
||||
}
|
||||
@@ -444,29 +444,29 @@ var gZenUIManager = {
|
||||
gURLBar._zenHandleUrlbarClose = null;
|
||||
}
|
||||
|
||||
const isFocusedBefore = gURLBar.focused;
|
||||
setTimeout(() => {
|
||||
// We use this attribute on Tabbrowser::addTab
|
||||
gURLBar.removeAttribute('zen-newtab');
|
||||
}, 0);
|
||||
|
||||
// Safely restore tab visual state with proper validation
|
||||
if (
|
||||
this._lastTab &&
|
||||
!this._lastTab.closing &&
|
||||
this._lastTab.ownerGlobal &&
|
||||
!this._lastTab.ownerGlobal.closed
|
||||
) {
|
||||
this._lastTab._visuallySelected = true;
|
||||
this._lastTab = null;
|
||||
}
|
||||
// Safely restore tab visual state with proper validation
|
||||
if (
|
||||
this._lastTab &&
|
||||
!this._lastTab.closing &&
|
||||
this._lastTab.ownerGlobal &&
|
||||
!this._lastTab.ownerGlobal.closed &&
|
||||
!onSwitch
|
||||
) {
|
||||
this._lastTab._visuallySelected = true;
|
||||
this._lastTab = null;
|
||||
}
|
||||
|
||||
// Reset newtab buttons
|
||||
for (const button of this.newtabButtons) {
|
||||
button.removeAttribute('in-urlbar');
|
||||
}
|
||||
// Reset newtab buttons
|
||||
for (const button of this.newtabButtons) {
|
||||
button.removeAttribute('in-urlbar');
|
||||
}
|
||||
|
||||
// Handle search data
|
||||
if (!onElementPicked) {
|
||||
// Handle search data
|
||||
if (onSwitch) {
|
||||
this.clearUrlbarData();
|
||||
} else {
|
||||
@@ -487,12 +487,8 @@ var gZenUIManager = {
|
||||
}
|
||||
|
||||
gURLBar.handleRevert();
|
||||
} else if (onElementPicked && onSwitch) {
|
||||
this.clearUrlbarData();
|
||||
}
|
||||
|
||||
if (gURLBar.focused) {
|
||||
setTimeout(() => {
|
||||
if (isFocusedBefore) {
|
||||
setTimeout(() => {
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('ZenURLBarClosed', { detail: { onSwitch, onElementPicked } })
|
||||
@@ -513,8 +509,8 @@ var gZenUIManager = {
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
}, 0);
|
||||
}
|
||||
}
|
||||
}, 0);
|
||||
},
|
||||
|
||||
urlbarTrim(aURL) {
|
||||
|
||||
@@ -330,8 +330,10 @@ zen-workspace {
|
||||
}
|
||||
}
|
||||
|
||||
&[active] .zen-workspace-empty-space {
|
||||
-moz-window-dragging: drag;
|
||||
@media -moz-pref('zen.view.draggable-sidebar') {
|
||||
&[active] .zen-workspace-empty-space {
|
||||
-moz-window-dragging: drag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user