Commit 37bd04f8 authored by dogmaphobic's avatar dogmaphobic

Made map buttons toggle between black and orange.

Adjusted icons so they no longer contain a background.
Added *Exclusive* functionality to the RoundButton element.
Added OnClicked signal for the drop down boxes so I could turn off Add Mission Item and Home Mode.
parent 13a187b8
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<circle opacity="0.95" cx="36" cy="36" r="34.2"/>
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<g>
<path fill="#FFFFFF" d="M33.787,48.612V38.146H23.401v-4.373h10.385V23.384h4.425v10.389h10.387v4.373H38.212v10.466H33.787z"/>
<path fill="#FFFFFF" d="M-55.213,94.612V84.146h-10.386v-4.373h10.385V69.384h4.425v10.389h10.387v4.373h-10.386v10.466
C-50.788,94.612-55.213,94.612-55.213,94.612z"/>
</g>
<circle fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" cx="36" cy="36" r="22.38"/>
<circle fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" cx="-53" cy="82" r="22.38"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<circle opacity="0.95" cx="36" cy="36" r="34.2"/>
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<g>
<circle fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" cx="36" cy="36" r="22.38"/>
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" x1="13.536" y1="35.975" x2="24.577" y2="36.025"/>
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" x1="35.975" y1="58.464" x2="36.025" y2="47.423"/>
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" x1="58.464" y1="36.025" x2="47.423" y2="35.975"/>
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" x1="36.025" y1="13.536" x2="35.975" y2="24.577"/>
<circle fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" cx="-53" cy="82" r="22.38"/>
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" x1="-75.464" y1="81.975" x2="-64.423" y2="82.025"/>
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" x1="-53.025" y1="104.464" x2="-52.975" y2="93.423"/>
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" x1="-30.536" y1="82.025" x2="-41.577" y2="81.975"/>
<line fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" x1="-52.975" y1="59.536" x2="-53.025" y2="70.577"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<circle opacity="0.95" cx="36" cy="36" r="34.2"/>
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<g>
<polygon fill="#FFFFFF" points="48.6,36.098 36,21.397 23.4,36.098 26.55,36.098 26.55,46.599 32.85,46.599 32.85,38.199
39.15,38.199 39.15,46.599 45.45,46.599 45.45,36.098 "/>
<polygon fill="#FFFFFF" points="-40.4,82.098 -53,67.397 -65.6,82.098 -62.45,82.098 -62.45,92.599 -56.15,92.599 -56.15,84.199
-49.85,84.199 -49.85,92.599 -43.55,92.599 -43.55,82.098 "/>
</g>
<circle fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" cx="36" cy="36" r="22.38"/>
<circle fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" cx="-53" cy="82" r="22.38"/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<circle opacity="0.95" cx="36" cy="36" r="34.2"/>
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<g>
<g>
<g>
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" d="M22.644,23.933C19.758,27.126,18,31.358,18,36
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" d="M-66.356,69.933C-69.242,73.126-71,77.358-71,82
c0,9.941,8.059,18,18,18c0.009,0,0.017-0.001,0.026-0.001"/>
<g>
<polygon fill="#FFFFFF" points="34.578,44.921 35.03,63.138 43.911,53.804 "/>
<polygon fill="#FFFFFF" points="-54.422,90.921 -53.97,109.138 -45.089,99.804 "/>
</g>
</g>
</g>
<g>
<g>
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" d="M49.356,48.067C52.242,44.874,54,40.642,54,36
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" d="M-39.644,94.067C-36.758,90.874-35,86.642-35,82
c0-9.941-8.059-18-18-18c-0.009,0-0.017,0.001-0.026,0.001"/>
<g>
<polygon fill="#FFFFFF" points="37.422,27.079 36.97,8.862 28.089,18.196 "/>
<polygon fill="#FFFFFF" points="-51.578,73.079 -52.03,54.862 -60.911,64.196 "/>
</g>
</g>
</g>
</g>
<g>
<path fill="none" d="M35.969,13.537"/>
<path fill="none" d="M-53.031,59.537"/>
</g>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 72 72" enable-background="new 0 0 72 72" xml:space="preserve">
<circle opacity="0.95" cx="36" cy="36" r="34.2"/>
<g>
<polygon stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" points="58.5,38.788 36,55.5 13.5,38.788 36,22.076 "/>
<polygon stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" points="58.5,33.212 36,49.924 13.5,33.212 36,16.5 "/>
</g>
viewBox="-89 46 72 72" enable-background="new -89 46 72 72" xml:space="preserve">
<polyline fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" points="-33.676,83.43 -30.5,85.789 -53,102.501
-75.5,85.789 -72.467,83.536 "/>
<path fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" d="M-53,69.077"/>
<polygon fill="none" stroke="#FFFFFF" stroke-width="2" stroke-miterlimit="10" points="-30.5,78.211 -53,94.923 -75.5,78.211
-53,61.499 "/>
</svg>
......@@ -139,9 +139,9 @@ QGCView {
RoundButton {
id: addMissionItemsButton
buttonImage: "/qmlimages/MapAddMission.svg"
opacity: _addMissionItems ? 1.0 : 0.75
exclusiveGroup: _dropButtonsExclusiveGroup
onClicked: {
_addMissionItems = !_addMissionItems
_addMissionItems = addMissionItemsButton.checked
_showHomePositionManager = false
}
}
......@@ -149,9 +149,9 @@ QGCView {
RoundButton {
id: homePositionManagerButton
buttonImage: "/qmlimages/MapHome.svg"
opacity: _showHomePositionManager ? 1.0 : 0.75
exclusiveGroup: _dropButtonsExclusiveGroup
onClicked: {
_showHomePositionManager = !_showHomePositionManager
_showHomePositionManager = homePositionManagerButton.checked
_addMissionItems = false
}
}
......@@ -163,6 +163,11 @@ QGCView {
viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup
onClicked: {
_showHomePositionManager = false
_addMissionItems = false
}
dropDownComponent: Component {
Row {
spacing: ScreenTools.defaultFontPixelWidth
......@@ -236,6 +241,11 @@ QGCView {
viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup
onClicked: {
_showHomePositionManager = false
_addMissionItems = false
}
dropDownComponent: Component {
Row {
spacing: ScreenTools.defaultFontPixelWidth
......@@ -288,6 +298,11 @@ QGCView {
viewportMargins: ScreenTools.defaultFontPixelWidth / 2
exclusiveGroup: _dropButtonsExclusiveGroup
onClicked: {
_showHomePositionManager = false
_addMissionItems = false
}
dropDownComponent: Component {
Row {
spacing: ScreenTools.defaultFontPixelWidth
......
......@@ -8,6 +8,7 @@ import QGroundControl.Palette 1.0
Item {
id: _root
signal clicked()
property alias buttonImage: button.source
property real radius: (ScreenTools.defaultFontPixelHeight * 3) / 2
property int dropDirection: dropDown
......@@ -148,8 +149,10 @@ Item {
width: _viewportMaxRight -_viewportMaxLeft
height: _viewportMaxBottom - _viewportMaxTop
visible: checked
onClicked: checked = false
onClicked: {
checked = false
_root.clicked()
}
}
// Button
......@@ -158,19 +161,21 @@ Item {
radius: width / 2
border.width: 2
border.color: "white"
color: "transparent"
opacity: checked ? 0.95 : 0.65
color: checked ? "orange" : "black"
Image {
id: button
anchors.fill: parent
fillMode: Image.PreserveAspectFit
opacity: checked ? 1.0 : 0.75
mipmap: true
smooth: true
MouseArea {
anchors.fill: parent
onClicked: checked = !checked
onClicked: {
checked = !checked
_root.clicked()
}
}
} // Image - button
}
......
......@@ -14,12 +14,22 @@ Item {
width: radius * 2
height: radius * 2
property bool checked: false
property ExclusiveGroup exclusiveGroup: null
onExclusiveGroupChanged: {
if (exclusiveGroup) {
exclusiveGroup.bindCheckable(_root)
}
}
Rectangle {
anchors.fill: parent
radius: width / 2
border.width: 2
border.color: "white"
color: "transparent"
opacity: checked ? 0.95 : 0.65
color: checked ? "orange" : "black"
Image {
id: button
anchors.fill: parent
......@@ -28,7 +38,10 @@ Item {
smooth: true
MouseArea {
anchors.fill: parent
onClicked: _root.clicked()
onClicked: {
checked = !checked
_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