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
e2d9e4bc
Commit
e2d9e4bc
authored
May 26, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Promoting preferences to top level panel.
parent
a6e25ea9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
132 deletions
+39
-132
MainWindowInner.qml
src/ui/MainWindowInner.qml
+30
-23
MainWindowLeftPanel.qml
src/ui/MainWindowLeftPanel.qml
+6
-106
LinkSettings.qml
src/ui/preferences/LinkSettings.qml
+0
-1
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+3
-2
No files found.
src/ui/MainWindowInner.qml
View file @
e2d9e4bc
...
...
@@ -40,8 +40,9 @@ Item {
signal
reallyClose
readonly
property
string
_planViewSource
:
"
MissionEditor.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
readonly
property
string
_planViewSource
:
"
MissionEditor.qml
"
readonly
property
string
_setupViewSource
:
"
SetupView.qml
"
readonly
property
string
_preferencesSource
:
"
MainWindowLeftPanel.qml
"
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
...
...
@@ -68,6 +69,7 @@ Item {
currentPopUp
.
close
()
}
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
preferencesPanel
.
visible
=
false
flightView
.
visible
=
true
setupViewLoader
.
visible
=
false
planViewLoader
.
visible
=
false
...
...
@@ -82,6 +84,7 @@ Item {
planViewLoader
.
source
=
_planViewSource
}
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
preferencesPanel
.
visible
=
false
flightView
.
visible
=
false
setupViewLoader
.
visible
=
false
planViewLoader
.
visible
=
true
...
...
@@ -97,12 +100,28 @@ Item {
if
(
setupViewLoader
.
source
!=
_setupViewSource
)
{
setupViewLoader
.
source
=
_setupViewSource
}
preferencesPanel
.
visible
=
false
flightView
.
visible
=
false
setupViewLoader
.
visible
=
true
planViewLoader
.
visible
=
false
toolBar
.
checkSetupButton
()
}
function
showPreferences
()
{
if
(
currentPopUp
)
{
currentPopUp
.
close
()
}
//-- In preferences view, the full height is available. Set to 0 so it is ignored.
ScreenTools
.
availableHeight
=
0
if
(
preferencesPanel
.
source
!=
_preferencesSource
)
{
preferencesPanel
.
source
=
_preferencesSource
}
flightView
.
visible
=
false
setupViewLoader
.
visible
=
false
planViewLoader
.
visible
=
false
preferencesPanel
.
visible
=
true
}
// The following are use for unit testing only
function
showSetupFirmware
()
{
...
...
@@ -182,11 +201,9 @@ Item {
}
}
//-- Detect tablet position
Connections
{
target
:
QGroundControl
.
qgcPositionManger
onLastPositionUpdated
:
{
if
(
valid
)
{
if
(
lastPosition
.
latitude
)
{
...
...
@@ -213,22 +230,6 @@ Item {
}
}
function
showLeftMenu
()
{
if
(
!
leftPanel
.
visible
)
{
leftPanel
.
visible
=
true
leftPanel
.
item
.
animateShowDialog
.
start
()
}
else
if
(
leftPanel
.
visible
&&
!
leftPanel
.
item
.
animateShowDialog
.
running
)
{
//-- If open, toggle it closed
hideLeftMenu
()
}
}
function
hideLeftMenu
()
{
if
(
leftPanel
.
visible
&&
!
leftPanel
.
item
.
animateHideDialog
.
running
)
{
leftPanel
.
item
.
animateHideDialog
.
start
()
}
}
function
formatMessage
(
message
)
{
message
=
message
.
replace
(
new
RegExp
(
"
<#E>
"
,
"
g
"
),
"
color: #f95e5e; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
message
=
message
.
replace
(
new
RegExp
(
"
<#I>
"
,
"
g
"
),
"
color: #f9b55e; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
...
...
@@ -273,12 +274,17 @@ Item {
//-- Left Settings Menu
Loader
{
id
:
left
Panel
id
:
preferences
Panel
anchors.fill
:
parent
visible
:
false
z
:
QGroundControl
.
zOrderTopMost
+
100
active
:
visible
source
:
"
MainWindowLeftPanel.qml
"
onVisibleChanged
:
{
console
.
log
(
"
Visible:
"
+
visible
)
if
(
!
visible
)
{
source
=
""
}
}
}
//-- Main UI
...
...
@@ -290,12 +296,13 @@ Item {
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
mainWindow
:
mainWindow
opaqueBackground
:
left
Panel
.
visible
opaqueBackground
:
preferences
Panel
.
visible
isBackgroundDark
:
flightView
.
isBackgroundDark
z
:
QGroundControl
.
zOrderTopMost
onShowSetupView
:
mainWindow
.
showSetupView
()
onShowPlanView
:
mainWindow
.
showPlanView
()
onShowFlyView
:
mainWindow
.
showFlyView
()
onShowPreferences
:
mainWindow
.
showPreferences
()
Component.onCompleted
:
{
ScreenTools
.
availableHeight
=
parent
.
height
-
toolBar
.
height
}
...
...
src/ui/MainWindowLeftPanel.qml
View file @
e2d9e4bc
...
...
@@ -37,69 +37,17 @@ Item {
id
:
settingsMenu
anchors.fill
:
parent
property
alias
animateShowDialog
:
__animateShowDialog
property
alias
animateHideDialog
:
__animateHideDialog
readonly
property
int
__animationDuration
:
100
readonly
property
real
__closeButtonSize
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
readonly
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
readonly
property
real
_buttonHeight
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
3
:
ScreenTools
.
defaultFontPixelHeight
*
2
QGCPalette
{
id
:
qgcPal
}
onVisibleChanged
:
{
//-- Unselect any selected button
panelActionGroup
.
current
=
null
//-- Destroy panel contents if not visible
if
(
!
visible
)
{
__rightPanel
.
source
=
""
}
}
function
closeSettings
()
{
__rightPanel
.
source
=
""
mainWindow
.
hideLeftMenu
()
}
ParallelAnimation
{
id
:
__animateShowDialog
NumberAnimation
{
target
:
__transparentSection
properties
:
"
opacity
"
from
:
0.0
to
:
0.8
duration
:
settingsMenu
.
__animationDuration
}
NumberAnimation
{
target
:
__transparentSection
properties
:
"
width
"
from
:
1
to
:
mainWindow
.
width
duration
:
settingsMenu
.
__animationDuration
}
}
ParallelAnimation
{
id
:
__animateHideDialog
NumberAnimation
{
target
:
__transparentSection
properties
:
"
opacity
"
from
:
0.8
to
:
0.0
duration
:
settingsMenu
.
__animationDuration
}
NumberAnimation
{
target
:
__transparentSection
properties
:
"
width
"
from
:
mainWindow
.
width
to
:
1
duration
:
settingsMenu
.
__animationDuration
}
onRunningChanged
:
{
if
(
!
running
)
{
parent
.
visible
=
false
}
}
Component.onCompleted
:
{
//-- Default to General Settings
__rightPanel
.
source
=
"
GeneralSettings.qml
"
_generalButton
.
checked
=
true
panelActionGroup
.
current
=
_generalButton
}
// This covers the screen with a transparent section
...
...
@@ -111,14 +59,6 @@ Item {
opacity
:
0.0
color
:
qgcPal
.
window
visible
:
__rightPanel
.
source
==
""
// Dismiss if clicked outside menu area
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
!
__animateShowDialog
.
running
)
mainWindow
.
hideLeftMenu
()
}
}
}
//-- Top Separator
...
...
@@ -164,6 +104,7 @@ Item {
}
QGCButton
{
id
:
_generalButton
height
:
_buttonHeight
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
...
...
@@ -266,18 +207,6 @@ Item {
}
}
//-- Clicking in tool bar area dismiss it all
MouseArea
{
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
height
:
toolBar
.
height
onClicked
:
{
if
(
!
__animateShowDialog
.
running
)
mainWindow
.
hideLeftMenu
()
}
}
//-- Vertical Separator
Rectangle
{
id
:
__verticalSeparator
...
...
@@ -302,34 +231,5 @@ Item {
id
:
__rightPanel
anchors.fill
:
parent
}
//-- Dismiss it all
Item
{
id
:
closeButton
width
:
__closeButtonSize
height
:
__closeButtonSize
anchors.right
:
parent
.
right
anchors.top
:
parent
.
top
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
QGCColoredImage
{
source
:
"
/res/XDelete.svg
"
mipmap
:
true
fillMode
:
Image
.
PreserveAspectFit
color
:
qgcPal
.
text
width
:
parent
.
width
*
0.75
height
:
parent
.
height
*
0.75
sourceSize.height
:
height
anchors.centerIn
:
parent
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
!
__animateShowDialog
.
running
)
{
__rightPanel
.
source
=
""
mainWindow
.
hideLeftMenu
()
}
}
}
}
}
}
src/ui/preferences/LinkSettings.qml
View file @
e2d9e4bc
...
...
@@ -151,7 +151,6 @@ Rectangle {
enabled
:
_currentSelection
&&
!
_currentSelection
.
link
onClicked
:
{
QGroundControl
.
linkManager
.
createConnectedLink
(
_currentSelection
)
settingsMenu
.
closeSettings
()
}
}
QGCButton
{
...
...
src/ui/toolbar/MainToolBar.qml
View file @
e2d9e4bc
...
...
@@ -58,6 +58,7 @@ Rectangle {
readonly
property
var
colorBlue
:
"
#636efe
"
readonly
property
var
colorWhite
:
"
#ffffff
"
signal
showPreferences
()
signal
showSetupView
()
signal
showPlanView
()
signal
showFlyView
()
...
...
@@ -347,8 +348,8 @@ Rectangle {
}
*/
MouseArea
{
anchors.fill
:
parent
onClicked
:
mainWindow
.
showLeftMenu
()
anchors.fill
:
parent
onClicked
:
toolBar
.
showPreferences
()
}
}
...
...
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