From 14f20c9e4e27bf0e57b06c7251e17bef9ad10c67 Mon Sep 17 00:00:00 2001
From: Terry Truong <terry06890@gmail.com>
Date: Sat, 28 May 2022 01:46:10 +1000
Subject: Allow keeping overflown-root after settings/tut events

Avoided keeping an overflown-root on resize, as it can get quite laggy.
---
 src/App.vue | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index 3a5a733..9fda4de 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -304,6 +304,7 @@ export default defineComponent({
 			this.setLastFocused(null);
 			LayoutNode.showDownward(layoutNode);
 			this.activeRoot = layoutNode;
+			this.overflownRoot = false;
 			this.updateAreaDims().then(() => this.relayoutWithCollapse());
 		},
 		// For tile-info events
@@ -596,6 +597,7 @@ export default defineComponent({
 				const resizeDelay = 100;
 				let handleResize = () => {
 					this.uiOpts.scrollGap = getScrollBarWidth();
+					this.overflownRoot = false;
 					return this.updateAreaDims().then(() => this.relayoutWithCollapse());
 				};
 				let currentTime = new Date().getTime();
@@ -696,7 +698,11 @@ export default defineComponent({
 			}
 		},
 		relayoutWithCollapse(secondPass = true){
-			this.overflownRoot = false;
+			if (this.overflownRoot){
+				tryLayout(this.activeRoot, [0,0], this.tileAreaDims,
+					{...this.lytOpts, layoutType: 'flex-sqr'}, {allowCollapse: false, layoutMap: this.layoutMap});
+				return;
+			}
 			tryLayout(this.activeRoot, [0,0], this.tileAreaDims, this.lytOpts,
 				{allowCollapse: true, layoutMap: this.layoutMap});
 			if (secondPass){
-- 
cgit v1.2.3

