From 92e151367d34884cc80479c28153fcffb6473f78 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Fri, 14 Aug 2020 15:09:38 -0700 Subject: [PATCH] Fix handling of popout analyse window --- src/AnalyzeView/AnalyzePage.qml | 15 ++++++--------- src/AnalyzeView/AnalyzeView.qml | 12 +++++------- src/ui/MainRootWindow.qml | 6 ++++++ 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/AnalyzeView/AnalyzePage.qml b/src/AnalyzeView/AnalyzePage.qml index 2a0b2ba..d2706c5 100644 --- a/src/AnalyzeView/AnalyzePage.qml +++ b/src/AnalyzeView/AnalyzePage.qml @@ -26,7 +26,7 @@ Item { property alias headerComponent: headerLoader.sourceComponent property real availableWidth: width - pageLoader.x property real availableHeight: height - mainContent.y - property bool poped: false + property bool popped: false property real _margins: ScreenTools.defaultFontPixelHeight * 0.5 signal popout() @@ -47,13 +47,13 @@ Item { anchors.top: parent.top anchors.left: parent.left anchors.rightMargin: _margins - anchors.right: floatIcon.left + anchors.right: floatIcon.visible ? floatIcon.left : parent.right spacing: _margins visible: !ScreenTools.isShortScreen && headerLoader.sourceComponent === null QGCLabel { id: pageNameLabel font.pointSize: ScreenTools.largeFontPointSize - visible: !poped + visible: !popped } QGCLabel { id: pageDescriptionLabel @@ -86,13 +86,10 @@ Item { source: "/qmlimages/FloatingWindow.svg" fillMode: Image.PreserveAspectFit color: qgcPal.text - visible: !poped && !ScreenTools.isMobile + visible: !popped && !ScreenTools.isMobile MouseArea { - anchors.fill: parent - onClicked: { - popout() - } + anchors.fill: parent + onClicked: popout() } } - } diff --git a/src/AnalyzeView/AnalyzeView.qml b/src/AnalyzeView/AnalyzeView.qml index c81de6c..f63eac8 100644 --- a/src/AnalyzeView/AnalyzeView.qml +++ b/src/AnalyzeView/AnalyzeView.qml @@ -7,11 +7,6 @@ * ****************************************************************************/ - -/// @file -/// @brief Setup View -/// @author Don Gagne - import QtQuick 2.3 import QtQuick.Window 2.2 import QtQuick.Controls 1.2 @@ -23,10 +18,12 @@ import QGroundControl.Controllers 1.0 import QGroundControl.ScreenTools 1.0 Rectangle { - id: setupView + id: _root color: qgcPal.window z: QGroundControl.zOrderTopMost + signal popout() + ExclusiveGroup { id: setupButtonGroup } readonly property real _defaultTextHeight: ScreenTools.defaultFontPixelHeight @@ -147,7 +144,8 @@ Rectangle { panelLoader.source = "" buttonRepeater.itemAt(_curIndex).loader.source = source buttonRepeater.itemAt(_curIndex).visible = false - buttonRepeater.itemAt(_curIndex).loader.item.poped = true + buttonRepeater.itemAt(_curIndex).loader.item.popped = true + _root.popout() } } diff --git a/src/ui/MainRootWindow.qml b/src/ui/MainRootWindow.qml index e8dfa45..d8d9d05 100644 --- a/src/ui/MainRootWindow.qml +++ b/src/ui/MainRootWindow.qml @@ -522,6 +522,12 @@ ApplicationWindow { anchors.right: parent.right anchors.top: toolDrawerToolbar.bottom anchors.bottom: parent.bottom + + Connections { + target: toolDrawerLoader.item + ignoreUnknownSignals: true + onPopout: toolDrawer.visible = false + } } }