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
fa12589e
Commit
fa12589e
authored
Aug 15, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add toolbar message support
Also restructured some toolbar positioning QML to handle resizing.
parent
af46dc40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
40 deletions
+72
-40
MainToolBar.h
src/ui/toolbar/MainToolBar.h
+2
-0
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+70
-40
No files found.
src/ui/toolbar/MainToolBar.h
View file @
fa12589e
...
...
@@ -91,6 +91,8 @@ public:
int
telemetryLRSSI
()
{
return
_telemetryLRSSI
;
}
int
connectionCount
()
{
return
_connectionCount
;
}
void
showToolBarMessage
(
const
QString
&
message
)
{
emit
showMessage
(
message
);
}
signals:
void
connectionCountChanged
(
int
count
);
void
currentViewChanged
();
...
...
src/ui/toolbar/MainToolBar.qml
View file @
fa12589e
...
...
@@ -45,7 +45,10 @@ Rectangle {
readonly
property
real
toolBarHeight
:
ScreenTools
.
defaultFontPixelHeight
*
3
property
int
cellSpacerSize
:
ScreenTools
.
isMobile
?
getProportionalDimmension
(
6
)
:
getProportionalDimmension
(
4
)
readonly
property
int
cellHeight
:
getProportionalDimmension
(
30
)
readonly
property
int
cellHeight
:
toolBarHeight
*
0.75
readonly
property
real
horizontalMargins
:
ScreenTools
.
defaultFontPixelWidth
/
2
readonly
property
real
verticalMargins
:
ScreenTools
.
defaultFontPixelHeight
/
4
readonly
property
var
colorBlue
:
"
#1a6eaa
"
readonly
property
var
colorGreen
:
"
#329147
"
...
...
@@ -62,7 +65,12 @@ Rectangle {
Connections
{
target
:
mainToolBar
onShowMessage
:
mainToolBar
.
height
=
100
onShowMessage
:
{
toolBarMessage
.
text
=
message
mainToolBar
.
height
=
toolBarHeight
+
toolBarMessage
.
contentHeight
+
verticalMargins
toolBarMessageArea
.
visible
=
true
}
}
function
getProportionalDimmension
(
val
)
{
...
...
@@ -183,24 +191,24 @@ Rectangle {
mainToolBar
.
onFlyViewMenu
();
}
}
}
}
// Menu
Row
{
id
:
row1
height
:
cellHeight
anchors.left
:
parent
.
left
spacing
:
getProportionalDimmension
(
4
)
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.leftMargin
:
getProportionalDimmension
(
10
)
id
:
toolRow
x
:
horizontalMargins
y
:
(
toolBarHeight
-
cellHeight
)
/
2
height
:
cellHeight
spacing
:
getProportionalDimmension
(
4
)
//---------------------------------------------------------------------
//-- Main menu for Non Mobile Devices (Chevron Buttons)
Row
{
id
:
row11
height
:
cellHeight
spacing
:
-
getProportionalDimmension
(
12
)
anchors.verticalCenter
:
parent
.
verticalCenter
visible
:
!
ScreenTools
.
isMobile
id
:
row11
height
:
cellHeight
spacing
:
-
getProportionalDimmension
(
12
)
anchors.top
:
parent
.
top
visible
:
!
ScreenTools
.
isMobile
Connections
{
target
:
ScreenTools
onRepaintRequested
:
{
...
...
@@ -219,7 +227,6 @@ Rectangle {
height
:
cellHeight
exclusiveGroup
:
mainActionGroup
text
:
qsTr
(
"
Setup
"
)
anchors.verticalCenter
:
parent
.
verticalCenter
checked
:
(
mainToolBar
.
currentView
===
MainToolBar
.
ViewSetup
)
onClicked
:
{
mainToolBar
.
onSetupView
();
...
...
@@ -233,7 +240,6 @@ Rectangle {
height
:
cellHeight
exclusiveGroup
:
mainActionGroup
text
:
qsTr
(
"
Plan
"
)
anchors.verticalCenter
:
parent
.
verticalCenter
checked
:
(
mainToolBar
.
currentView
===
MainToolBar
.
ViewPlan
)
onClicked
:
{
mainToolBar
.
onPlanView
();
...
...
@@ -247,7 +253,6 @@ Rectangle {
height
:
cellHeight
exclusiveGroup
:
mainActionGroup
text
:
qsTr
(
"
Fly
"
)
anchors.verticalCenter
:
parent
.
verticalCenter
checked
:
(
mainToolBar
.
currentView
===
MainToolBar
.
ViewFly
)
onClicked
:
{
mainToolBar
.
onFlyView
();
...
...
@@ -261,15 +266,13 @@ Rectangle {
height
:
cellHeight
exclusiveGroup
:
mainActionGroup
text
:
qsTr
(
"
Analyze
"
)
anchors.verticalCenter
:
parent
.
verticalCenter
checked
:
(
mainToolBar
.
currentView
===
MainToolBar
.
ViewAnalyze
)
onClicked
:
{
mainToolBar
.
onAnalyzeView
();
}
z
:
700
}
}
}
// Row
//---------------------------------------------------------------------
//-- Indicators
...
...
@@ -673,17 +676,17 @@ Rectangle {
color
:
colorRedText
}
}
}
}
}
// Row
}
// Row
Row
{
id
:
row2
height
:
cellHeight
spacing
:
cellSpacerSize
anchors.
right
:
parent
.
right
anchors.verticalCenter
:
parent
.
verticalCenter
anchors.leftMargin
:
getProportionalDimmension
(
10
)
anchors.rightMargin
:
getProportionalDimmension
(
10
)
id
:
connectRow
anchors.rightMargin
:
verticalMargins
anchors.right
:
parent
.
right
anchors.
top
:
toolRow
.
top
anchors.verticalCenter
:
toolRow
.
verticalCenter
height
:
toolRow
.
height
spacing
:
cellSpacerSize
Menu
{
id
:
connectMenu
...
...
@@ -718,7 +721,6 @@ Rectangle {
visible
:
mainToolBar
.
connectionCount
===
0
text
:
qsTr
(
"
Connect
"
)
menu
:
connectMenu
anchors.verticalCenter
:
parent
.
verticalCenter
}
QGCButton
{
...
...
@@ -726,7 +728,6 @@ Rectangle {
width
:
getProportionalDimmension
(
100
)
visible
:
mainToolBar
.
connectionCount
===
1
text
:
qsTr
(
"
Disconnect
"
)
anchors.verticalCenter
:
parent
.
verticalCenter
onClicked
:
{
mainToolBar
.
onDisconnect
(
""
);
}
...
...
@@ -756,18 +757,47 @@ Rectangle {
text
:
"
Disconnect
"
visible
:
mainToolBar
.
connectionCount
>
1
menu
:
disconnectMenu
anchors.verticalCenter
:
parent
.
verticalCenter
}
}
}
// Row
// Progress bar
Rectangle
{
readonly
property
int
progressBarHeight
:
getProportionalDimmension
(
3
)
y
:
parent
.
height
-
progressBarHeight
height
:
progressBarHeight
width
:
parent
.
width
*
mainToolBar
.
progressBarValue
color
:
qgcPal
.
text
id
:
progressBar
anchors.top
:
toolRow
.
bottom
height
:
getProportionalDimmension
(
3
)
width
:
parent
.
width
*
mainToolBar
.
progressBarValue
color
:
qgcPal
.
text
}
}
// Toolbar message area
Rectangle
{
id
:
toolBarMessageArea
anchors.margins
:
horizontalMargins
anchors.top
:
progressBar
.
bottom
anchors.bottom
:
parent
.
bottom
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
color
:
qgcPal
.
windowShadeDark
visible
:
false
QGCLabel
{
id
:
toolBarMessage
anchors.fill
:
parent
wrapMode
:
Text
.
WordWrap
}
QGCButton
{
id
:
toolBarMessageCloseButton
anchors.rightMargin
:
horizontalMargins
anchors.topMargin
:
verticalMargins
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
text
:
"
Close Message
"
onClicked
:
{
parent
.
visible
=
false
mainToolBar
.
height
=
toolBarHeight
}
}
}
}
// Rectangle
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