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 {
...
@@ -20,6 +20,8 @@ Rectangle {
border.width
:
_showBorder
?
1
:
0
border.width
:
_showBorder
?
1
:
0
border.color
:
qgcPal
.
buttonText
border.color
:
qgcPal
.
buttonText
property
var
tileSet
:
null
property
var
currentSet
:
null
property
bool
checked
:
false
property
bool
checked
:
false
property
bool
complete
:
false
property
bool
complete
:
false
property
alias
text
:
nameLabel
.
text
property
alias
text
:
nameLabel
.
text
...
@@ -37,6 +39,19 @@ Rectangle {
...
@@ -37,6 +39,19 @@ Rectangle {
signal
clicked
()
signal
clicked
()
property
ExclusiveGroup
exclusiveGroup
:
null
onExclusiveGroupChanged
:
{
if
(
exclusiveGroup
)
{
checked
=
false
exclusiveGroup
.
bindCheckable
(
mapButton
)
}
}
onCheckedChanged
:
{
if
(
checked
)
{
currentSet
=
tileSet
}
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
Row
{
Row
{
...
@@ -85,26 +100,53 @@ Rectangle {
...
@@ -85,26 +100,53 @@ Rectangle {
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
hoverEnabled
:
tru
e
hoverEnabled
:
!
ScreenTools
.
isMobil
e
onMouseXChanged
:
{
onMouseXChanged
:
{
if
(
!
ScreenTools
.
isMobile
)
{
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
}
}
onMouseYChanged
:
{
onMouseYChanged
:
{
if
(
!
ScreenTools
.
isMobile
)
{
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseX
=
ScreenTools
.
mouseX
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
_lastGlobalMouseY
=
ScreenTools
.
mouseY
()
}
}
onEntered
:
{
_hovered
=
true
;
_forceHoverOff
=
false
;
hoverTimer
.
start
()
}
}
onExited
:
{
_hovered
=
false
;
_forceHoverOff
=
false
;
hoverTimer
.
stop
()
}
onEntered
:
{
onPressed
:
{
_pressed
=
true
;
}
if
(
!
ScreenTools
.
isMobile
)
{
onReleased
:
{
_pressed
=
false
;
}
_hovered
=
true
onClicked
:
mapButton
.
clicked
()
_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
{
Timer
{
id
:
hoverTimer
id
:
hoverTimer
interval
:
250
interval
:
250
repeat
:
tru
e
repeat
:
!
ScreenTools
.
isMobil
e
onTriggered
:
{
onTriggered
:
{
if
(
_lastGlobalMouseX
!==
ScreenTools
.
mouseX
()
||
_lastGlobalMouseY
!==
ScreenTools
.
mouseY
())
{
if
(
_lastGlobalMouseX
!==
ScreenTools
.
mouseX
()
||
_lastGlobalMouseY
!==
ScreenTools
.
mouseY
())
{
_forceHoverOff
=
true
_forceHoverOff
=
true
...
...
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
ba6522b4
...
@@ -918,11 +918,14 @@ QGCView {
...
@@ -918,11 +918,14 @@ QGCView {
width
:
Math
.
min
(
_tileSetList
.
width
,
(
ScreenTools
.
defaultFontPixelWidth
*
50
).
toFixed
(
0
))
width
:
Math
.
min
(
_tileSetList
.
width
,
(
ScreenTools
.
defaultFontPixelWidth
*
50
).
toFixed
(
0
))
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
spacing
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenter
:
parent
.
horizontalCenter
ExclusiveGroup
{
id
:
selectionGroup
}
OfflineMapButton
{
OfflineMapButton
{
id
:
firstButton
id
:
firstButton
text
:
qsTr
(
"
Add New Set
"
)
text
:
qsTr
(
"
Add New Set
"
)
width
:
_cacheList
.
width
width
:
_cacheList
.
width
height
:
ScreenTools
.
defaultFontPixelHeight
*
2
height
:
ScreenTools
.
defaultFontPixelHeight
*
(
ScreenTools
.
isMobile
?
3
:
2
)
currentSet
:
_currentSelection
exclusiveGroup
:
selectionGroup
onClicked
:
{
onClicked
:
{
offlineMapView
.
_currentSelection
=
null
offlineMapView
.
_currentSelection
=
null
addNewSet
()
addNewSet
()
...
@@ -936,7 +939,10 @@ QGCView {
...
@@ -936,7 +939,10 @@ QGCView {
tiles
:
object
.
totalTileCount
tiles
:
object
.
totalTileCount
complete
:
object
.
complete
complete
:
object
.
complete
width
:
firstButton
.
width
width
:
firstButton
.
width
height
:
ScreenTools
.
defaultFontPixelHeight
*
2
height
:
ScreenTools
.
defaultFontPixelHeight
*
(
ScreenTools
.
isMobile
?
3
:
2
)
exclusiveGroup
:
selectionGroup
currentSet
:
_currentSelection
tileSet
:
object
onClicked
:
{
onClicked
:
{
offlineMapView
.
_currentSelection
=
object
offlineMapView
.
_currentSelection
=
object
showInfo
()
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