Bug 1933258 - Add pref for when to move other tabs out of the way during drag and drop. r=sthompson,tabbrowser-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D230142
This commit is contained in:
Dão Gottwald
2024-11-26 16:20:26 +00:00
parent e23baebe69
commit 8f56f70b33
2 changed files with 11 additions and 3 deletions

View File

@@ -1032,6 +1032,7 @@ pref("browser.tabs.hoverPreview.showThumbnails", true);
pref("browser.tabs.groups.enabled", false);
pref("browser.tabs.groups.dragOverThresholdPercent", 20);
pref("browser.tabs.groups.dragOverDelayMS", 30);
pref("browser.tabs.dragdrop.moveOverThresholdPercent", 70);
pref("browser.tabs.firefox-view.logLevel", "Warn");

View File

@@ -2326,7 +2326,12 @@
}
return index;
};
let moveOverThreshold = gBrowser._tabGroupsEnabled ? 0.7 : 0.5;
let moveOverThreshold = gBrowser._tabGroupsEnabled
? Services.prefs.getIntPref(
"browser.tabs.dragdrop.moveOverThresholdPercent"
) / 100
: 0.5;
moveOverThreshold = Math.min(1, Math.max(0, moveOverThreshold));
let newIndex = getDragOverIndex(moveOverThreshold);
if (newIndex >= oldIndex) {
newIndex++;
@@ -2341,8 +2346,10 @@
Services.prefs.getIntPref(
"browser.tabs.groups.dragOverThresholdPercent"
) / 100;
dragOverGroupingThreshold = Math.max(0, dragOverGroupingThreshold);
dragOverGroupingThreshold = Math.min(0.5, dragOverGroupingThreshold);
dragOverGroupingThreshold = Math.min(
moveOverThreshold,
Math.max(0, dragOverGroupingThreshold)
);
let groupDropIndex = getDragOverIndex(dragOverGroupingThreshold);
if (
"groupDropIndex" in dragData &&