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
ba6522b4
Commit
ba6522b4
authored
Feb 06, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiple selected state for offline maps buttons.
parent
bc0afbca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
14 deletions
+62
-14
OfflineMapButton.qml
src/QmlControls/OfflineMapButton.qml
+54
-12
OfflineMap.qml
src/QtLocationPlugin/QMLControl/OfflineMap.qml
+8
-2
No files found.
src/QmlControls/OfflineMapButton.qml
View file @
ba6522b4
...
...
@@ -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
:
{
if
(
!
ScreenTools
.
isMobile
)
{
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
}
onMouseYChanged
:
{
if
(
!
ScreenTools
.
isMobile
)
{
_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
()
}
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 @
ba6522b4
...
...
@@ -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
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