Commit a5d3df39 authored by DonLakeFlyer's avatar DonLakeFlyer Committed by Don Gagne

Use FocusScope in all the right places

parent bc171f06
...@@ -45,9 +45,17 @@ Rectangle { ...@@ -45,9 +45,17 @@ Rectangle {
colorGroupEnabled: enabled colorGroupEnabled: enabled
} }
FocusScope {
id: currentItemScope
anchors.fill: parent
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: _root.clicked() onClicked: {
currentItemScope.focus = true
_root.clicked()
}
}
} }
QGCLabel { QGCLabel {
...@@ -76,7 +84,14 @@ Rectangle { ...@@ -76,7 +84,14 @@ Rectangle {
QGCMouseArea { QGCMouseArea {
fillItem: hamburger fillItem: hamburger
visible: hamburger.visible visible: hamburger.visible
onClicked: _waypointsOnlyMode ? waypointsOnlyMenu.popup() : normalMenu.popup() onClicked: {
currentItemScope.focus = true
if (_waypointsOnlyMode) {
waypointsOnlyMenu.popup()
} else {
normalMenu.popup()
}
}
Menu { Menu {
id: normalMenu id: normalMenu
......
...@@ -6,12 +6,11 @@ import QtGraphicalEffects 1.0 ...@@ -6,12 +6,11 @@ import QtGraphicalEffects 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
QGCMouseArea { FocusScope {
id: _root id: _root
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: column.height height: column.height
onClicked: checked = !checked
property alias text: label.text property alias text: label.text
property bool checked: true property bool checked: true
...@@ -27,6 +26,14 @@ QGCMouseArea { ...@@ -27,6 +26,14 @@ QGCMouseArea {
QGCPalette { id: qgcPal; colorGroupEnabled: true } QGCPalette { id: qgcPal; colorGroupEnabled: true }
QGCMouseArea {
anchors.fill: parent
onClicked: {
_root.focus = true
checked = !checked
}
ColumnLayout { ColumnLayout {
id: column id: column
anchors.left: parent.left anchors.left: parent.left
...@@ -61,4 +68,5 @@ QGCMouseArea { ...@@ -61,4 +68,5 @@ QGCMouseArea {
color: qgcPal.text color: qgcPal.text
} }
} }
}
} }
...@@ -68,7 +68,10 @@ Button { ...@@ -68,7 +68,10 @@ Button {
} }
} }
onClicked: popup.toggleShow() onClicked: {
combo.focus = true
popup.toggleShow()
}
Component.onCompleted: { Component.onCompleted: {
if (currentIndex === -1) { if (currentIndex === -1) {
......
...@@ -163,10 +163,14 @@ Rectangle { ...@@ -163,10 +163,14 @@ Rectangle {
visible: index == 0 ? _showOptionalElements : true visible: index == 0 ? _showOptionalElements : true
} }
Rectangle { FocusScope {
id: scope
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: width height: width
Rectangle {
anchors.fill: parent
color: checked ? _repeaterPal.buttonHighlight : _repeaterPal.button color: checked ? _repeaterPal.buttonHighlight : _repeaterPal.button
QGCColoredImage { QGCColoredImage {
...@@ -210,6 +214,7 @@ Rectangle { ...@@ -210,6 +214,7 @@ Rectangle {
preventStealing: true preventStealing: true
onClicked: { onClicked: {
scope.focus = true
if (modelData.dropPanelComponent === undefined) { if (modelData.dropPanelComponent === undefined) {
dropPanel.hide() dropPanel.hide()
if (modelData.toggle === true) { if (modelData.toggle === true) {
...@@ -233,6 +238,7 @@ Rectangle { ...@@ -233,6 +238,7 @@ Rectangle {
} }
} }
} }
}
Item { Item {
width: 1 width: 1
......
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