Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
0619847e
Unverified
Commit
0619847e
authored
Feb 06, 2018
by
Gus Grubba
Committed by
GitHub
Feb 06, 2018
Browse files
Merge pull request #6115 from mavlink/offlineMaps
Fix multiple selected state for offline maps buttons.
parents
bc0afbca
ba6522b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/QmlControls/OfflineMapButton.qml
View file @
0619847e
...
...
@@ -20,6 +20,8 @@ Rectangle {
border.width
:
_showBorder
?
1
:
0
border.color
:
qgcPal
.
buttonText
property
var
tileSet
:
null
property
var
currentSet
:
null
property
bool
checked
:
false
property
bool
complete
:
false
property
alias
text
:
nameLabel
.
text
...
...
@@ -37,6 +39,19 @@ Rectangle {
signal
clicked
()
property
ExclusiveGroup
exclusiveGroup
:
null
onExclusiveGroupChanged
:
{
if
(
exclusiveGroup
)
{
checked
=
false
exclusiveGroup
.
bindCheckable
(
mapButton
)
}
}
onCheckedChanged
:
{
if
(
checked
)
{
currentSet
=
tileSet
}
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
Row
{
...
...
@@ -85,26 +100,53 @@ Rectangle {
MouseArea
{
anchors.fill
:
parent
hoverEnabled
:
tru
e
hoverEnabled
:
!
ScreenTools
.
isMobil
e
onMouseXChanged
:
{
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
if
(
!
ScreenTools
.
isMobile
)
{
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
}
onMouseYChanged
:
{
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
onEntered
:
{
_hovered
=
true
;
_forceHoverOff
=
false
;
hoverTimer
.
start
()
}
onExited
:
{
_hovered
=
false
;
_forceHoverOff
=
false
;
hoverTimer
.
stop
()
}
onPressed
:
{
_pressed
=
true
;
}
onReleased
:
{
_pressed
=
false
;
}
onClicked
:
mapButton
.
clicked
()
if
(
!
ScreenTools
.
isMobile
)
{
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
}
onEntered
:
{
if
(
!
ScreenTools
.
isMobile
)
{
_hovered
=
true
_forceHoverOff
=
false
hoverTimer
.
start
()
}
}
onExited
:
{
if
(
!
ScreenTools
.
isMobile
)
{
_hovered
=
false
_forceHoverOff
=
false
hoverTimer
.
stop
()
}
}
onPressed
:
{
if
(
!
ScreenTools
.
isMobile
)
{
_pressed
=
true
}
}
onReleased
:
{
if
(
!
ScreenTools
.
isMobile
)
{
_pressed
=
false
}
}
onClicked
:
{
checked
=
true
mapButton
.
clicked
()
}
}
Timer
{
id
:
hoverTimer
interval
:
250
repeat
:
tru
e
repeat
:
!
ScreenTools
.
isMobil
e
onTriggered
:
{
if
(
_lastGlobalMouseX
!==
ScreenTools
.
mouseX
()
||
_lastGlobalMouseY
!==
ScreenTools
.
mouseY
())
{
_forceHoverOff
=
true
...
...
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
0619847e
...
...
@@ -918,11 +918,14 @@ QGCView {
width
:
Math
.
min
(
_tileSetList
.
width
,
(
ScreenTools
.
defaultFontPixelWidth
*
50
).
toFixed
(
0
))
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.horizontalCenter
:
parent
.
horizontalCenter
ExclusiveGroup
{
id
:
selectionGroup
}
OfflineMapButton
{
id
:
firstButton
text
:
qsTr
(
"
Add New Set
"
)
width
:
_cacheList
.
width
height
:
ScreenTools
.
defaultFontPixelHeight
*
2
height
:
ScreenTools
.
defaultFontPixelHeight
*
(
ScreenTools
.
isMobile
?
3
:
2
)
currentSet
:
_currentSelection
exclusiveGroup
:
selectionGroup
onClicked
:
{
offlineMapView
.
_currentSelection
=
null
addNewSet
()
...
...
@@ -936,7 +939,10 @@ QGCView {
tiles
:
object
.
totalTileCount
complete
:
object
.
complete
width
:
firstButton
.
width
height
:
ScreenTools
.
defaultFontPixelHeight
*
2
height
:
ScreenTools
.
defaultFontPixelHeight
*
(
ScreenTools
.
isMobile
?
3
:
2
)
exclusiveGroup
:
selectionGroup
currentSet
:
_currentSelection
tileSet
:
object
onClicked
:
{
offlineMapView
.
_currentSelection
=
object
showInfo
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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