Browse Source

Fix toolstrip recalc

QGC4.4
DonLakeFlyer 8 years ago
parent
commit
844e678010
  1. 14
      src/QmlControls/ToolStrip.qml

14
src/QmlControls/ToolStrip.qml

@ -39,7 +39,7 @@ Rectangle {
// whether to show or hide the optional elements on the fly. // whether to show or hide the optional elements on the fly.
property bool _showOptionalElements: true property bool _showOptionalElements: true
property bool _needRecalc: true property bool _needRecalc: false
Component.onCompleted: recalcShowOptionalElements() Component.onCompleted: recalcShowOptionalElements()
@ -54,7 +54,6 @@ Rectangle {
onDefaultFontPixelHeightChanged: recalcShowOptionalElements() onDefaultFontPixelHeightChanged: recalcShowOptionalElements()
} }
/*
onHeightChanged: { onHeightChanged: {
if (_needRecalc) { if (_needRecalc) {
_needRecalc = false _needRecalc = false
@ -63,18 +62,13 @@ Rectangle {
} }
} }
} }
*/
function recalcShowOptionalElements() { function recalcShowOptionalElements() {
if (_showOptionalElements) { if (maxHeight > 0) {
if (maxHeight && height > maxHeight) { _needRecalc = false
_showOptionalElements = false _showOptionalElements = height <= maxHeight
}
} else {
_needRecalc = true _needRecalc = true
_showOptionalElements = true
} }
} }
QGCPalette { id: qgcPal } QGCPalette { id: qgcPal }

Loading…
Cancel
Save