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
20606a57
Commit
20606a57
authored
Jul 01, 2016
by
Don Gagne
Committed by
GitHub
Jul 01, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Help text for toolbar buttons (#3711)
parent
7736e244
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
44 deletions
+90
-44
QGCToolBarButton.qml
src/QmlControls/QGCToolBarButton.qml
+69
-9
MainWindowInner.qml
src/ui/MainWindowInner.qml
+1
-0
MainToolBar.qml
src/ui/toolbar/MainToolBar.qml
+20
-35
No files found.
src/QmlControls/QGCToolBarButton.qml
View file @
20606a57
...
...
@@ -16,17 +16,22 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
ScreenTools
1.0
Item
{
id
:
_root
id
:
_root
state
:
"
HelpShown
"
clip
:
true
property
alias
source
:
icon
.
source
property
bool
checked
:
false
property
alias
text
:
helpText
.
text
property
alias
source
:
icon
.
source
property
bool
checked
:
false
property
bool
logo
:
false
property
ExclusiveGroup
exclusiveGroup
:
null
readonly
property
real
_topBottomMargins
:
ScreenTools
.
defaultFontPixelHeight
/
2
signal
clicked
()
QGCPalette
{
id
:
qgcPal
}
readonly
property
real
_topBottomMargins
:
ScreenTools
.
defaultFontPixelHeight
/
2
property
real
_helpTextBottomMargin
:
0
property
real
_imageBottomMargin
:
0
onExclusiveGroupChanged
:
{
if
(
exclusiveGroup
)
{
...
...
@@ -34,17 +39,62 @@ Item {
}
}
QGCPalette
{
id
:
qgcPal
}
states
:
[
State
{
name
:
"
HelpShown
"
},
State
{
name
:
"
HelpHidden
"
PropertyChanges
{
target
:
imageAnimation
;
running
:
true
}
PropertyChanges
{
target
:
helpTextAnimation
;
running
:
true
}
}
]
PropertyAnimation
{
id
:
imageAnimation
target
:
_root
property
:
"
_imageBottomMargin
"
duration
:
1000
easing.type
:
Easing
.
InOutQuad
to
:
_topBottomMargins
from
:
0
}
PropertyAnimation
{
id
:
helpTextAnimation
target
:
_root
property
:
"
_helpTextBottomMargin
"
duration
:
1000
easing.type
:
Easing
.
InOutQuad
to
:
-
helpText
.
height
from
:
0
}
Timer
{
interval
:
10000
running
:
true
onTriggered
:
_root
.
state
=
"
HelpHidden
"
}
Rectangle
{
anchors.fill
:
parent
visible
:
logo
color
:
"
#4A2C6D
"
}
QGCColoredImage
{
id
:
icon
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.topMargin
:
_topBottomMargins
anchors.bottomMargin
:
_topBottomMargins
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
anchors.bottomMargin
:
_imageBottomMargin
anchors.bottom
:
helpText
.
top
sourceSize.height
:
parent
.
height
fillMode
:
Image
.
PreserveAspectFit
color
:
checked
?
qgcPal
.
buttonHighlight
:
qgcPal
.
buttonText
color
:
logo
?
"
white
"
:
(
checked
?
qgcPal
.
buttonHighlight
:
qgcPal
.
buttonText
)
}
Rectangle
{
...
...
@@ -56,6 +106,16 @@ Item {
visible
:
checked
}
QGCLabel
{
id
:
helpText
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.bottomMargin
:
_helpTextBottomMargin
anchors.bottom
:
parent
.
bottom
horizontalAlignment
:
Text
.
AlignHCenter
color
:
logo
?
"
white
"
:
qgcPal
.
buttonText
}
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
...
...
src/ui/MainWindowInner.qml
View file @
20606a57
...
...
@@ -107,6 +107,7 @@ Item {
setupViewLoader
.
visible
=
false
planViewLoader
.
visible
=
false
preferencesPanel
.
visible
=
true
toolBar
.
checkPreferencesButton
()
}
// The following are use for unit testing only
...
...
src/ui/toolbar/MainToolBar.qml
View file @
20606a57
...
...
@@ -52,6 +52,10 @@ Rectangle {
MainToolBarController
{
id
:
_controller
}
function
checkPreferencesButton
()
{
preferencesButton
.
checked
=
true
}
function
checkSetupButton
()
{
setupButton
.
checked
=
true
}
...
...
@@ -307,53 +311,31 @@ Rectangle {
visible
:
qgcPal
.
globalTheme
==
QGCPalette
.
Light
}
//---------------------------------------------
// Logo (Preferences Button)
Rectangle
{
id
:
preferencesButton
width
:
mainWindow
.
tbButtonWidth
*
1.25
height
:
parent
.
height
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
color
:
"
#4A2C6D
"
Image
{
height
:
mainWindow
.
tbCellHeight
anchors.centerIn
:
parent
source
:
"
/res/QGCLogoWhite
"
fillMode
:
Image
.
PreserveAspectFit
smooth
:
true
mipmap
:
true
antialiasing
:
true
}
/* Experimenting with a white/black divider
Rectangle {
color: qgcPal.globalTheme === QGCPalette.Light ? Qt.rgba(0,0,0,0.15) : Qt.rgba(1,1,1,0.15)
height: parent.height
width: 1
anchors.right: parent.right
anchors.top: parent.top
}
*/
MouseArea
{
anchors.fill
:
parent
onClicked
:
toolBar
.
showPreferences
()
}
}
//---------------------------------------------
// Toolbar Row
Row
{
id
:
viewRow
height
:
mainWindow
.
tbCellHeight
spacing
:
mainWindow
.
tbSpacing
anchors.left
:
preferencesButton
.
right
anchors.leftMargin
:
mainWindow
.
tbSpacing
anchors.left
:
parent
.
left
anchors.bottomMargin
:
1
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
ExclusiveGroup
{
id
:
mainActionGroup
}
QGCToolBarButton
{
id
:
preferencesButton
width
:
mainWindow
.
tbButtonWidth
anchors.top
:
parent
.
top
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
source
:
"
/res/QGCLogoWhite
"
logo
:
true
text
:
"
Settings
"
onClicked
:
toolBar
.
showPreferences
()
}
QGCToolBarButton
{
id
:
setupButton
width
:
mainWindow
.
tbButtonWidth
...
...
@@ -361,6 +343,7 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/Gears.svg
"
text
:
"
Setup
"
onClicked
:
toolBar
.
showSetupView
()
}
...
...
@@ -371,6 +354,7 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/Plan.svg
"
text
:
"
Plan
"
onClicked
:
toolBar
.
showPlanView
()
}
...
...
@@ -381,6 +365,7 @@ Rectangle {
anchors.bottom
:
parent
.
bottom
exclusiveGroup
:
mainActionGroup
source
:
"
/qmlimages/PaperPlane.svg
"
text
:
"
Fly
"
onClicked
:
toolBar
.
showFlyView
()
}
}
...
...
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