Commit a204a40b authored by Don Gagne's avatar Don Gagne

MissionEditor usability changes

parent e100631f
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<file alias="MockLink.params">src/comm/MockLink.params</file> <file alias="MockLink.params">src/comm/MockLink.params</file>
<file alias="FactSystemTest.qml">src/FactSystem/FactSystemTest.qml</file> <file alias="FactSystemTest.qml">src/FactSystem/FactSystemTest.qml</file>
</qresource> </qresource>
<qresource prefix="/qmlimages"> <qresource prefix="/qmlimages">
<file alias="SafetyComponentTree.svg">src/AutoPilotPlugins/PX4/Images/SafetyComponentTree.svg</file> <file alias="SafetyComponentTree.svg">src/AutoPilotPlugins/PX4/Images/SafetyComponentTree.svg</file>
<file alias="SafetyComponentHome.png">src/AutoPilotPlugins/PX4/Images/SafetyComponentHome.png</file> <file alias="SafetyComponentHome.png">src/AutoPilotPlugins/PX4/Images/SafetyComponentHome.png</file>
...@@ -66,6 +67,9 @@ ...@@ -66,6 +67,9 @@
<file alias="MapCenter.svg">src/FlightMap/Images/MapCenter.svg</file> <file alias="MapCenter.svg">src/FlightMap/Images/MapCenter.svg</file>
<file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file> <file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file>
<file alias="ZoomMinus.svg">src/FlightMap/Images/ZoomMinus.svg</file> <file alias="ZoomMinus.svg">src/FlightMap/Images/ZoomMinus.svg</file>
<!-- Map Buttons -->
<file alias="Sync.png">resources/Sync.png</file>
</qresource> </qresource>
<qresource prefix="/qml"> <qresource prefix="/qml">
<file alias="test.qml">src/test.qml</file> <file alias="test.qml">src/test.qml</file>
......
This diff is collapsed.
...@@ -23,10 +23,6 @@ Item { ...@@ -23,10 +23,6 @@ Item {
readonly property int dropUp: 3 readonly property int dropUp: 3
readonly property int dropDown: 4 readonly property int dropDown: 4
function hideDropDown() {
_showDropDown = false
}
readonly property real _arrowBaseWidth: (radius * 2) / 2 // Width of long side of arrow readonly property real _arrowBaseWidth: (radius * 2) / 2 // Width of long side of arrow
readonly property real _arrowPointHeight: (radius * 2) / 3 // Height is long side to point readonly property real _arrowPointHeight: (radius * 2) / 3 // Height is long side to point
readonly property real _dropCornerRadius: ScreenTools.defaultFontPixelWidth / 2 readonly property real _dropCornerRadius: ScreenTools.defaultFontPixelWidth / 2
...@@ -39,7 +35,20 @@ Item { ...@@ -39,7 +35,20 @@ Item {
property real _viewportMaxTop: -y + viewportMargins property real _viewportMaxTop: -y + viewportMargins
property real _viewportMaxBottom: parent.height - (viewportMargins * 2) - y property real _viewportMaxBottom: parent.height - (viewportMargins * 2) - y
property bool _showDropDown: false // Set up ExclusiveGroup support. We use the checked property to drive visibility of drop down.
property bool checked: false
property ExclusiveGroup exclusiveGroup: null
onExclusiveGroupChanged: {
if (exclusiveGroup) {
exclusiveGroup.bindCheckable(_root)
}
}
function hideDropDown() {
checked = false
}
Component.onCompleted: _calcPositions() Component.onCompleted: _calcPositions()
...@@ -138,29 +147,37 @@ Item { ...@@ -138,29 +147,37 @@ Item {
y: _viewportMaxTop y: _viewportMaxTop
width: _viewportMaxRight -_viewportMaxLeft width: _viewportMaxRight -_viewportMaxLeft
height: _viewportMaxBottom - _viewportMaxTop height: _viewportMaxBottom - _viewportMaxTop
visible: _showDropDown visible: checked
onClicked: _showDropDown = false onClicked: checked = false
} }
// Button // Button
Image { Rectangle {
id: button
anchors.fill: parent anchors.fill: parent
fillMode: Image.PreserveAspectFit radius: width / 2
opacity: _showDropDown ? 1.0 : 0.75 border.width: 2
mipmap: true border.color: "white"
smooth: true color: "transparent"
MouseArea {
anchors.fill: parent Image {
id: button
onClicked: _showDropDown = !_showDropDown anchors.fill: parent
} fillMode: Image.PreserveAspectFit
} // Image - button opacity: checked ? 1.0 : 0.75
mipmap: true
smooth: true
MouseArea {
anchors.fill: parent
onClicked: checked = !checked
}
} // Image - button
}
Item { Item {
id: dropDownItem id: dropDownItem
visible: _showDropDown visible: checked
QGCCanvas { QGCCanvas {
id: arrowCanvas id: arrowCanvas
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment