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
6b10539a
Commit
6b10539a
authored
Mar 09, 2017
by
Don Gagne
Committed by
GitHub
Mar 09, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4734 from DonLakeFlyer/MoreTouch
Automatic sizing support in QGCMouseArea
parents
d3b5726d
085fc473
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
25 deletions
+27
-25
MissionItemEditor.qml
src/MissionEditor/MissionItemEditor.qml
+3
-14
SimpleItemMapVisual.qml
src/MissionEditor/SimpleItemMapVisual.qml
+1
-1
MissionItemIndexLabel.qml
src/QmlControls/MissionItemIndexLabel.qml
+3
-9
QGCMouseArea.qml
src/QmlControls/QGCMouseArea.qml
+20
-1
No files found.
src/MissionEditor/MissionItemEditor.qml
View file @
6b10539a
...
...
@@ -69,21 +69,10 @@ Rectangle {
}
QGCMouseArea
{
// The MouseArea for the hamburger is larger than the hamburger image itself in order to provide a larger
// touch area on mobile
anchors.leftMargin
:
-
_touchMarginHorizontal
anchors.rightMargin
:
-
_touchMarginHorizontal
anchors.topMargin
:
-
_touchMarginVertical
anchors.bottomMargin
:
-
_touchMarginVertical
anchors.fill
:
hamburger
fillItem
:
hamburger
visible
:
hamburger
.
visible
onClicked
:
hamburgerMenu
.
popup
()
property
real
_touchWidth
:
Math
.
max
(
hamburger
.
width
,
ScreenTools
.
minTouchPixels
)
property
real
_touchHeight
:
Math
.
max
(
hamburger
.
height
,
ScreenTools
.
minTouchPixels
)
property
real
_touchMarginHorizontal
:
ScreenTools
.
isMobile
?
(
_touchWidth
-
hamburger
.
width
)
/
2
:
0
property
real
_touchMarginVertical
:
ScreenTools
.
isMobile
?
(
_touchHeight
-
hamburger
.
height
)
/
2
:
0
Menu
{
id
:
hamburgerMenu
...
...
src/MissionEditor/SimpleItemMapVisual.qml
View file @
6b10539a
...
...
@@ -51,7 +51,7 @@ Item {
}
function
showDragArea
()
{
if
(
!
_dragAreaShowing
)
{
if
(
!
_dragAreaShowing
&&
_missionItem
.
specifiesCoordinate
)
{
_dragArea
=
dragAreaComponent
.
createObject
(
map
)
_dragAreaShowing
=
true
}
...
...
src/QmlControls/MissionItemIndexLabel.qml
View file @
6b10539a
...
...
@@ -73,14 +73,8 @@ Canvas {
onWidthChanged
:
requestPaint
()
}
MouseArea
{
anchors.leftMargin
:
-
_expandMargin
anchors.rightMargin
:
_expandMargin
anchors.topMargin
:
-
_expandMargin
anchors.bottomMargin
:
_expandMargin
anchors.fill
:
parent
QGCMouseArea
{
fillItem
:
parent
onClicked
:
parent
.
clicked
()
property
real
_expandMargin
:
ScreenTools
.
isMobile
?
ScreenTools
.
defaultFontPixelWidth
:
0
}
}
src/QmlControls/QGCMouseArea.qml
View file @
6b10539a
import
QtQuick
2.3
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
/// Works just like a regular MouseArea except:
/// 1) It supports the ability to show touch extents based on QGroundControl.showTouchAreas
/// 2) You can specify fillItem and it will automatically fill to the size and adjust touch areas on mobile
MouseArea
{
anchors.leftMargin
:
fillItem
?
-
_touchMarginHorizontal
:
0
anchors.rightMargin
:
fillItem
?
-
_touchMarginHorizontal
:
0
anchors.topMargin
:
fillItem
?
-
_touchMarginVertical
:
0
anchors.bottomMargin
:
fillItem
?
-
_touchMarginVertical
:
0
anchors.fill
:
fillItem
?
fillItem
:
undefined
property
var
fillItem
property
real
_itemWidth
:
fillItem
?
fillItem
.
width
:
width
property
real
_itemHeight
:
fillItem
?
fillItem
.
height
:
height
property
real
_touchWidth
:
Math
.
max
(
_itemWidth
,
ScreenTools
.
minTouchPixels
)
property
real
_touchHeight
:
Math
.
max
(
_itemHeight
,
ScreenTools
.
minTouchPixels
)
property
real
_touchMarginHorizontal
:
ScreenTools
.
isMobile
?
(
_touchWidth
-
_itemWidth
)
/
2
:
0
property
real
_touchMarginVertical
:
ScreenTools
.
isMobile
?
(
_touchHeight
-
_itemHeight
)
/
2
:
0
Rectangle
{
anchors.fill
:
parent
border.color
:
"
red
"
...
...
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