Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
a5d3df39
Commit
a5d3df39
authored
Apr 05, 2017
by
DonLakeFlyer
Committed by
Don Gagne
Apr 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use FocusScope in all the right places
parent
bc171f06
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
90 deletions
+122
-90
MissionItemEditor.qml
src/PlanView/MissionItemEditor.qml
+18
-3
SectionHeader.qml
src/PlanView/SectionHeader.qml
+36
-28
QGCComboBox.qml
src/QmlControls/QGCComboBox.qml
+4
-1
ToolStrip.qml
src/QmlControls/ToolStrip.qml
+64
-58
No files found.
src/PlanView/MissionItemEditor.qml
View file @
a5d3df39
...
@@ -45,9 +45,17 @@ Rectangle {
...
@@ -45,9 +45,17 @@ Rectangle {
colorGroupEnabled
:
enabled
colorGroupEnabled
:
enabled
}
}
MouseArea
{
FocusScope
{
id
:
currentItemScope
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
_root
.
clicked
()
MouseArea
{
anchors.fill
:
parent
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
...
...
src/PlanView/SectionHeader.qml
View file @
a5d3df39
...
@@ -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,38 +26,47 @@ QGCMouseArea {
...
@@ -27,38 +26,47 @@ QGCMouseArea {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
ColumnLayout
{
QGCMouseArea
{
id
:
column
anchors.fill
:
parent
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
Item
{
onClicked
:
{
height
:
_sectionSpacer
_root
.
focus
=
true
width
:
1
checked
=
!
checked
visible
:
showSpacer
}
}
QGCLabel
{
ColumnLayout
{
id
:
label
id
:
column
Layout.fillWidth
:
true
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
QGCColoredImage
{
Item
{
id
:
image
height
:
_sectionSpacer
width
:
label
.
height
/
2
width
:
1
height
:
width
visible
:
showSpacer
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
/qmlimages/arrow-down.png
"
color
:
qgcPal
.
text
visible
:
!
_root
.
checked
}
}
}
Rectangle
{
QGCLabel
{
anchors.left
:
parent
.
left
id
:
label
anchors.right
:
parent
.
right
Layout.fillWidth
:
true
height
:
1
color
:
qgcPal
.
text
QGCColoredImage
{
id
:
image
width
:
label
.
height
/
2
height
:
width
anchors.right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
source
:
"
/qmlimages/arrow-down.png
"
color
:
qgcPal
.
text
visible
:
!
_root
.
checked
}
}
Rectangle
{
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
1
color
:
qgcPal
.
text
}
}
}
}
}
}
}
src/QmlControls/QGCComboBox.qml
View file @
a5d3df39
...
@@ -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
)
{
...
...
src/QmlControls/ToolStrip.qml
View file @
a5d3df39
...
@@ -163,71 +163,77 @@ Rectangle {
...
@@ -163,71 +163,77 @@ 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
color
:
checked
?
_repeaterPal
.
buttonHighlight
:
_repeaterPal
.
button
QGCColoredImage
{
id
:
button
anchors.fill
:
parent
source
:
_source
sourceSize.height
:
parent
.
height
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
color
:
checked
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
buttonText
RotationAnimation
on
rotation
{
id
:
imageRotation
loops
:
Animation
.
Infinite
from
:
0
to
:
360
duration
:
500
running
:
false
}
NumberAnimation
on
opacity
{
Rectangle
{
id
:
opacityAnimation
anchors.fill
:
parent
running
:
false
color
:
checked
?
_repeaterPal
.
buttonHighlight
:
_repeaterPal
.
button
from
:
0
to
:
1.0
QGCColoredImage
{
loops
:
Animation
.
Infinite
id
:
button
duration
:
2000
anchors.fill
:
parent
source
:
_source
sourceSize.height
:
parent
.
height
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
color
:
checked
?
_repeaterPal
.
buttonHighlightText
:
_repeaterPal
.
buttonText
RotationAnimation
on
rotation
{
id
:
imageRotation
loops
:
Animation
.
Infinite
from
:
0
to
:
360
duration
:
500
running
:
false
}
NumberAnimation
on
opacity
{
id
:
opacityAnimation
running
:
false
from
:
0
to
:
1.0
loops
:
Animation
.
Infinite
duration
:
2000
}
}
}
}
QGCMouseArea
{
QGCMouseArea
{
// Size of mouse area is expanded to make touch easier
// Size of mouse area is expanded to make touch easier
anchors.leftMargin
:
-
buttonStripColumn
.
anchors
.
margins
anchors.leftMargin
:
-
buttonStripColumn
.
anchors
.
margins
anchors.rightMargin
:
-
buttonStripColumn
.
anchors
.
margins
anchors.rightMargin
:
-
buttonStripColumn
.
anchors
.
margins
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
height
:
parent
.
height
+
(
_showOptionalElements
?
buttonLabel
.
height
+
buttonColumn
.
spacing
:
0
)
height
:
parent
.
height
+
(
_showOptionalElements
?
buttonLabel
.
height
+
buttonColumn
.
spacing
:
0
)
visible
:
_buttonEnabled
visible
:
_buttonEnabled
preventStealing
:
true
preventStealing
:
true
onClicked
:
{
onClicked
:
{
if
(
modelData
.
dropPanelComponent
===
undefined
)
{
scope
.
focus
=
true
dropPanel
.
hide
()
if
(
modelData
.
dropPanelComponent
===
undefined
)
{
if
(
modelData
.
toggle
===
true
)
{
dropPanel
.
hide
()
checked
=
!
checked
if
(
modelData
.
toggle
===
true
)
{
}
else
{
checked
=
!
checked
// dropPanel.hide above will close panel, but we need to do this to clear toggles
}
else
{
uncheckAll
()
// dropPanel.hide above will close panel, but we need to do this to clear toggles
}
uncheckAll
()
_root
.
clicked
(
index
,
checked
)
}
}
else
{
_root
.
clicked
(
index
,
checked
)
if
(
checked
)
{
dropPanel
.
hide
()
// hide affects checked, so this needs to be duplicated inside not outside if
}
else
{
}
else
{
dropPanel
.
hide
()
// hide affects checked, so this needs to be duplicated inside not outside if
if
(
checked
)
{
uncheckAll
()
dropPanel
.
hide
()
// hide affects checked, so this needs to be duplicated inside not outside if
checked
=
true
}
else
{
var
panelEdgeTopPoint
=
mapToItem
(
_root
,
width
,
0
)
dropPanel
.
hide
()
// hide affects checked, so this needs to be duplicated inside not outside if
dropPanel
.
show
(
panelEdgeTopPoint
,
height
,
modelData
.
dropPanelComponent
)
uncheckAll
()
checked
=
true
var
panelEdgeTopPoint
=
mapToItem
(
_root
,
width
,
0
)
dropPanel
.
show
(
panelEdgeTopPoint
,
height
,
modelData
.
dropPanelComponent
)
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment