Commit 6bdc8428 authored by DonLakeFlyer's avatar DonLakeFlyer

Use FocusScope in all the right places

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