mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 22:09:59 +02:00
Resize other splitNodes evenly when removing node
This commit is contained in:
parent
9186c24c79
commit
3c8006df0e
1 changed files with 3 additions and 3 deletions
|
@ -67,7 +67,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
|||
_tabToSplitNode = new Map();
|
||||
dropZone;
|
||||
_edgeHoverSize = 20;
|
||||
_minResizeWidth;
|
||||
minResizeWidth;
|
||||
|
||||
init() {
|
||||
XPCOMUtils.defineLazyPreferenceGetter(this, 'canChangeTabOnHover', 'zen.splitView.change-on-hover', false);
|
||||
|
@ -150,8 +150,8 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
|||
const childIndex = parent.children.indexOf(toRemove);
|
||||
parent.children.splice(childIndex, 1);
|
||||
if (parent.children.length !== 1) {
|
||||
const nodeToResize = parent.children[Math.max(0, childIndex - 1)];
|
||||
nodeToResize.sizeInParent += toRemove.sizeInParent;
|
||||
const otherNodeIncrease = 100 / (100 - toRemove.sizeInParent);
|
||||
parent.children.forEach(c => c.sizeInParent *= otherNodeIncrease);
|
||||
return parent;
|
||||
}
|
||||
// node that is not a leaf cannot have less than 2 children, this makes for better resizing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue