From 844e678010a99d60317759936df09bae58244310 Mon Sep 17 00:00:00 2001
From: DonLakeFlyer <don@thegagnes.com>
Date: Thu, 6 Apr 2017 16:21:41 -0700
Subject: [PATCH] Fix toolstrip recalc

---
 src/QmlControls/ToolStrip.qml | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/QmlControls/ToolStrip.qml b/src/QmlControls/ToolStrip.qml
index 9152a7f24d..7acc118f28 100644
--- a/src/QmlControls/ToolStrip.qml
+++ b/src/QmlControls/ToolStrip.qml
@@ -39,7 +39,7 @@ Rectangle {
     // whether to show or hide the optional elements on the fly.
 
     property bool _showOptionalElements:    true
-    property bool _needRecalc:              true
+    property bool _needRecalc:              false
 
     Component.onCompleted: recalcShowOptionalElements()
 
@@ -54,7 +54,6 @@ Rectangle {
         onDefaultFontPixelHeightChanged:    recalcShowOptionalElements()
     }
 
-    /*
     onHeightChanged: {
         if (_needRecalc) {
             _needRecalc = false
@@ -63,18 +62,13 @@ Rectangle {
             }
         }
     }
-    */
 
     function recalcShowOptionalElements() {
-        if (_showOptionalElements) {
-            if (maxHeight && height > maxHeight) {
-                _showOptionalElements = false
-            }
-        } else {
+        if (maxHeight > 0) {
+            _needRecalc = false
+            _showOptionalElements =  height <= maxHeight
             _needRecalc = true
-            _showOptionalElements = true
         }
-
     }
 
     QGCPalette { id: qgcPal }
-- 
GitLab