Commit 9967011d authored by dogmaphobic's avatar dogmaphobic

Adding a RoundButton element.

Also moving the Plan View tool bar buttons into a Row element.
parent 70a09b88
...@@ -114,6 +114,7 @@ ...@@ -114,6 +114,7 @@
<file alias="QGroundControl/Controls/MissionItemSummary.qml">src/QmlControls/MissionItemSummary.qml</file> <file alias="QGroundControl/Controls/MissionItemSummary.qml">src/QmlControls/MissionItemSummary.qml</file>
<file alias="QGroundControl/Controls/MissionItemEditor.qml">src/QmlControls/MissionItemEditor.qml</file> <file alias="QGroundControl/Controls/MissionItemEditor.qml">src/QmlControls/MissionItemEditor.qml</file>
<file alias="QGroundControl/Controls/DropButton.qml">src/QmlControls/DropButton.qml</file> <file alias="QGroundControl/Controls/DropButton.qml">src/QmlControls/DropButton.qml</file>
<file alias="QGroundControl/Controls/RoundButton.qml">src/QmlControls/RoundButton.qml</file>
<file alias="QGroundControl/Controls/QGCCanvas.qml">src/QmlControls/QGCCanvas.qml</file> <file alias="QGroundControl/Controls/QGCCanvas.qml">src/QmlControls/QGCCanvas.qml</file>
<!-- Vehicle Setup --> <!-- Vehicle Setup -->
......
...@@ -130,51 +130,34 @@ QGCView { ...@@ -130,51 +130,34 @@ QGCView {
} }
} }
Image { Row {
spacing: ScreenTools.defaultFontPixelWidth
anchors.top: parent.top
anchors.right: parent.right
anchors.margins: ScreenTools.defaultFontPixelWidth
RoundButton {
id: addMissionItemsButton id: addMissionItemsButton
anchors.rightMargin: ScreenTools.defaultFontPixelHeight buttonImage: "/qmlimages/MapAddMission.svg"
anchors.right: homePositionManagerButton.left
anchors.top: homePositionManagerButton.top
width: ScreenTools.defaultFontPixelHeight * 3
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
source: "/qmlimages/MapAddMission.svg"
opacity: _addMissionItems ? 1.0 : 0.75 opacity: _addMissionItems ? 1.0 : 0.75
MouseArea {
anchors.fill: parent
onClicked: { onClicked: {
_addMissionItems = !_addMissionItems _addMissionItems = !_addMissionItems
_showHomePositionManager = false _showHomePositionManager = false
} }
} }
}
Image { RoundButton {
id: homePositionManagerButton id: homePositionManagerButton
anchors.rightMargin: ScreenTools.defaultFontPixelHeight buttonImage: "/qmlimages/MapHome.svg"
anchors.right: centerMapButton.left
anchors.top: centerMapButton.top
width: ScreenTools.defaultFontPixelHeight * 3
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
source: "/qmlimages/MapHome.svg"
opacity: _showHomePositionManager ? 1.0 : 0.75 opacity: _showHomePositionManager ? 1.0 : 0.75
MouseArea {
anchors.fill: parent
onClicked: { onClicked: {
_showHomePositionManager = !_showHomePositionManager _showHomePositionManager = !_showHomePositionManager
_addMissionItems = false _addMissionItems = false
} }
} }
}
DropButton { DropButton {
id: centerMapButton id: centerMapButton
anchors.rightMargin: ScreenTools.defaultFontPixelHeight
anchors.right: syncButton.left
anchors.top: syncButton.top
dropDirection: dropDown dropDirection: dropDown
buttonImage: "/qmlimages/MapCenter.svg" buttonImage: "/qmlimages/MapCenter.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
...@@ -207,9 +190,9 @@ QGCView { ...@@ -207,9 +190,9 @@ QGCView {
} }
} }
/* /*
This code will need to wait for Qml 5.5 support since Map.visibleRegion is only in Qt 5.5 This code will need to wait for Qml 5.5 support since Map.visibleRegion is only in Qt 5.5
QGCButton { QGCButton {
text: "All Items" text: "All Items"
...@@ -241,16 +224,13 @@ This code will need to wait for Qml 5.5 support since Map.visibleRegion is only ...@@ -241,16 +224,13 @@ This code will need to wait for Qml 5.5 support since Map.visibleRegion is only
editorMap.visibleRegion = region editorMap.visibleRegion = region
} }
} }
*/ */
} }
} }
} }
DropButton { DropButton {
id: syncButton id: syncButton
anchors.rightMargin: ScreenTools.defaultFontPixelHeight
anchors.right: mapTypeButton.left
anchors.top: mapTypeButton.top
dropDirection: dropDown dropDirection: dropDown
buttonImage: "/qmlimages/MapSync.svg" buttonImage: "/qmlimages/MapSync.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
...@@ -303,9 +283,6 @@ This code will need to wait for Qml 5.5 support since Map.visibleRegion is only ...@@ -303,9 +283,6 @@ This code will need to wait for Qml 5.5 support since Map.visibleRegion is only
DropButton { DropButton {
id: mapTypeButton id: mapTypeButton
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.top: parent.top
anchors.right: parent.right
dropDirection: dropDown dropDirection: dropDown
buttonImage: "/qmlimages/MapType.svg" buttonImage: "/qmlimages/MapType.svg"
viewportMargins: ScreenTools.defaultFontPixelWidth / 2 viewportMargins: ScreenTools.defaultFontPixelWidth / 2
...@@ -334,6 +311,7 @@ This code will need to wait for Qml 5.5 support since Map.visibleRegion is only ...@@ -334,6 +311,7 @@ This code will need to wait for Qml 5.5 support since Map.visibleRegion is only
} }
} }
} }
}
MissionItemIndicator { MissionItemIndicator {
label: "H" label: "H"
......
...@@ -14,6 +14,7 @@ QGCCanvas 1.0 QGCCanvas.qml ...@@ -14,6 +14,7 @@ QGCCanvas 1.0 QGCCanvas.qml
SubMenuButton 1.0 SubMenuButton.qml SubMenuButton 1.0 SubMenuButton.qml
IndicatorButton 1.0 IndicatorButton.qml IndicatorButton 1.0 IndicatorButton.qml
DropButton 1.0 DropButton.qml DropButton 1.0 DropButton.qml
RoundButton 1.0 RoundButton.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.qml VehicleSummaryRow 1.0 VehicleSummaryRow.qml
ViewWidget 1.0 ViewWidget.qml ViewWidget 1.0 ViewWidget.qml
......
import QtQuick 2.4
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2
import QGroundControl.ScreenTools 1.0
Item {
id: _root
signal clicked()
property alias buttonImage: button.source
property real radius: (ScreenTools.defaultFontPixelHeight * 3) / 2
width: radius * 2
height: radius * 2
Rectangle {
anchors.fill: parent
radius: width / 2
border.width: 2
border.color: "white"
color: "transparent"
Image {
id: button
anchors.fill: parent
fillMode: Image.PreserveAspectFit
mipmap: true
smooth: true
MouseArea {
anchors.fill: parent
onClicked: _root.clicked()
}
}
}
}
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