From 0d77a9cf4c47bc465a4b28ccd4587fe3244c2092 Mon Sep 17 00:00:00 2001 From: DonLakeFlyer Date: Wed, 14 Mar 2018 11:52:33 -0700 Subject: [PATCH] Fix compass rose sizing --- src/PlanView/SurveyItemEditor.qml | 60 +++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/src/PlanView/SurveyItemEditor.qml b/src/PlanView/SurveyItemEditor.qml index d5f085a..33cffd6 100644 --- a/src/PlanView/SurveyItemEditor.qml +++ b/src/PlanView/SurveyItemEditor.qml @@ -440,16 +440,28 @@ Rectangle { Layout.fillWidth: true } - ToolButton { - id: windRoseButton - anchors.verticalCenter: angleText.verticalCenter - iconSource: qgcPal.globalTheme === QGCPalette.Light ? "/res/wind-roseBlack.svg" : "/res/wind-rose.svg" - visible: _vehicle.fixedWing + Rectangle { + id: windRoseButton + width: ScreenTools.implicitTextFieldHeight + height: width + color: qgcPal.button + visible: _vehicle.fixedWing + + QGCColoredImage { + anchors.fill: parent + source: "/res/wind-rose.svg" + smooth: true + color: qgcPal.buttonText + } - onClicked: { - windRosePie.angle = Number(gridAngleText.text) - var cords = windRoseButton.mapToItem(_root, 0, 0) - windRosePie.popup(cords.x + windRoseButton.width / 2, cords.y + windRoseButton.height / 2) + QGCMouseArea { + fillItem: parent + + onClicked: { + windRosePie.angle = Number(gridAngleText.text) + var cords = windRoseButton.mapToItem(_root, 0, 0) + windRosePie.popup(cords.x + windRoseButton.width / 2, cords.y + windRoseButton.height / 2) + } } } } @@ -543,16 +555,28 @@ Rectangle { Layout.fillWidth: true } - ToolButton { - id: manualWindRoseButton - anchors.verticalCenter: manualAngleText.verticalCenter - Layout.columnSpan: 1 - iconSource: qgcPal.globalTheme === QGCPalette.Light ? "/res/wind-roseBlack.svg" : "/res/wind-rose.svg" - visible: _vehicle.fixedWing + Rectangle { + id: manualWindRoseButton + width: ScreenTools.implicitTextFieldHeight + height: width + color: qgcPal.button + visible: _vehicle.fixedWing - onClicked: { - var cords = manualWindRoseButton.mapToItem(_root, 0, 0) - windRosePie.popup(cords.x + manualWindRoseButton.width / 2, cords.y + manualWindRoseButton.height / 2) + QGCColoredImage { + anchors.fill: parent + source: "/res/wind-rose.svg" + smooth: true + color: qgcPal.buttonText + } + + QGCMouseArea { + fillItem: parent + + onClicked: { + windRosePie.angle = Number(gridAngleText.text) + var cords = manualWindRoseButton.mapToItem(_root, 0, 0) + windRosePie.popup(cords.x + manualWindRoseButton.width / 2, cords.y + manualWindRoseButton.height / 2) + } } } }