Commit 13a187b8 authored by Don Gagne's avatar Don Gagne

Merge pull request #1969 from dogmaphobic/roundButton

Adding a RoundButton element.
parents 70a09b88 9967011d
...@@ -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 -->
......
This diff is collapsed.
...@@ -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