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
043d72c2
Commit
043d72c2
authored
Sep 21, 2017
by
Don Gagne
Committed by
GitHub
Sep 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5653 from bluerobotics/pr-pip-resize
Allow resizing pip window
parents
2ae9a2b8
2296322d
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
462 additions
and
2 deletions
+462
-2
qgcresources.qrc
qgcresources.qrc
+1
-0
FlightDisplayView.qml
src/FlightDisplay/FlightDisplayView.qml
+4
-1
pipResize.svg
src/FlightMap/Images/pipResize.svg
+373
-0
QGCPipable.qml
src/QmlControls/QGCPipable.qml
+84
-1
No files found.
qgcresources.qrc
View file @
043d72c2
...
...
@@ -107,6 +107,7 @@
<file alias="compassInstrumentDial.svg">src/FlightMap/Images/compassInstrumentDial.svg</file>
<file alias="crossHair.svg">src/FlightMap/Images/crossHair.svg</file>
<file alias="PiP.svg">src/FlightMap/Images/PiP.svg</file>
<file alias="pipResize.svg">src/FlightMap/Images/pipResize.svg</file>
<file alias="rollDialWhite.svg">src/FlightMap/Images/rollDialWhite.svg</file>
<file alias="rollPointerWhite.svg">src/FlightMap/Images/rollPointerWhite.svg</file>
<file alias="scale.png">src/FlightMap/Images/scale.png</file>
...
...
src/FlightDisplay/FlightDisplayView.qml
View file @
043d72c2
...
...
@@ -49,7 +49,7 @@ QGCView {
property
bool
_isPipVisible
:
QGroundControl
.
videoManager
.
hasVideo
?
QGroundControl
.
loadBoolGlobalSetting
(
_PIPVisibleKey
,
true
)
:
false
property
real
_savedZoomLevel
:
0
property
real
_margins
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_pipSize
:
mainWindo
w
.
width
*
0.2
property
real
_pipSize
:
flightVie
w
.
width
*
0.2
property
alias
_guidedController
:
guidedActionsController
property
alias
_altitudeSlider
:
altitudeSlider
...
...
@@ -285,6 +285,9 @@ QGCView {
onHideIt
:
{
setPipVisibility
(
!
state
)
}
onNewWidth
:
{
_pipSize
=
newWidth
}
}
Row
{
...
...
src/FlightMap/Images/pipResize.svg
0 → 100644
View file @
043d72c2
This diff is collapsed.
Click to expand it.
src/QmlControls/QGCPipable.qml
View file @
043d72c2
...
...
@@ -22,17 +22,100 @@ Item {
property
bool
isHidden
:
false
property
bool
isDark
:
false
// As a percentage of the window width
property
real
maxSize
:
0.75
property
real
minSize
:
0.10
signal
activated
()
signal
hideIt
(
bool
state
)
signal
newWidth
(
real
newWidth
)
MouseArea
{
id
:
pipMouseArea
anchors.fill
:
parent
enabled
:
!
isHidden
hoverEnabled
:
true
onClicked
:
{
pip
.
activated
()
}
}
// MouseArea to drag in order to resize the PiP area
MouseArea
{
id
:
pipResize
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
height
:
ScreenTools
.
minTouchPixels
width
:
height
property
var
initialX
:
0
property
var
initialWidth
:
0
onClicked
:
{
// TODO propagate
}
// When we push the mouse button down, we un-anchor the mouse area to prevent a resizing loop
onPressed
:
{
pipResize
.
anchors
.
top
=
undefined
// Top doesn't seem to 'detach'
pipResize
.
anchors
.
right
=
undefined
// This one works right, which is what we really need
pipResize
.
initialX
=
mouse
.
x
pipResize
.
initialWidth
=
pip
.
width
}
// When we let go of the mouse button, we re-anchor the mouse area in the correct position
onReleased
:
{
pipResize
.
anchors
.
top
=
pip
.
top
pipResize
.
anchors
.
right
=
pip
.
right
}
// Drag
onPositionChanged
:
{
if
(
pipResize
.
pressed
)
{
var
parentW
=
pip
.
parent
.
width
// flightView
var
newW
=
pipResize
.
initialWidth
+
mouse
.
x
-
pipResize
.
initialX
if
(
newW
<
parentW
*
maxSize
&&
newW
>
parentW
*
minSize
)
{
newWidth
(
newW
)
}
}
}
}
// Resize icon
Image
{
source
:
"
/qmlimages/pipResize.svg
"
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
visible
:
!
isHidden
&&
(
ScreenTools
.
isMobile
||
pipMouseArea
.
containsMouse
)
height
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
width
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
sourceSize.height
:
height
}
// Resize pip window if necessary when main window is resized
property
var
pipLock
:
2
Connections
{
target
:
pip
.
parent
onWidthChanged
:
{
// hackity hack...
// don't fire this while app is loading/initializing (it happens twice)
if
(
pipLock
)
{
pipLock
--
return
}
var
parentW
=
pip
.
parent
.
width
if
(
pip
.
width
>
parentW
*
maxSize
)
{
newWidth
(
parentW
*
maxSize
)
}
else
if
(
pip
.
width
<
parentW
*
minSize
)
{
newWidth
(
parentW
*
minSize
)
}
}
}
//-- PIP Corner Indicator
Image
{
id
:
closePIP
...
...
@@ -41,7 +124,7 @@ Item {
fillMode
:
Image
.
PreserveAspectFit
anchors.left
:
parent
.
left
anchors.bottom
:
parent
.
bottom
visible
:
!
isHidden
visible
:
!
isHidden
&&
(
ScreenTools
.
isMobile
||
pipMouseArea
.
containsMouse
)
height
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
width
:
ScreenTools
.
defaultFontPixelHeight
*
2.5
sourceSize.height
:
height
...
...
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