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
6dbf6dab
Commit
6dbf6dab
authored
Jan 25, 2012
by
Bryant Mairs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tooltip to all the appropriate labels on the toolbar.
Also reorganized the code to be more readable.
parent
55ed021e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
13 deletions
+31
-13
QGCToolBar.cc
src/ui/QGCToolBar.cc
+31
-13
No files found.
src/ui/QGCToolBar.cc
View file @
6dbf6dab
...
...
@@ -55,18 +55,28 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
// Add internal actions
// Add MAV widget
symbolButton
=
new
QToolButton
(
this
);
symbolButton
->
setStyleSheet
(
"QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; } QToolButton { font-weight: bold; font-size: 12px; border: 0px solid #999999; border-radius: 5px; min-width:22px; max-width: 22px; min-height: 22px; max-height: 22px; padding: 0px; margin: 0px 0px 0px 20px; background-color: none; }"
);
addWidget
(
symbolButton
);
toolBarNameLabel
=
new
QLabel
(
"------"
,
this
);
toolBarNameLabel
->
setToolTip
(
tr
(
"Currently controlled vehicle"
));
addWidget
(
toolBarNameLabel
);
toolBarSafetyLabel
=
new
QLabel
(
"SAFE"
,
this
);
toolBarSafetyLabel
->
setStyleSheet
(
"QLabel { margin: 0px 2px; font: 14px; color: #14C814; }"
);
toolBarSafetyLabel
->
setToolTip
(
tr
(
"Vehicle safety state"
));
addWidget
(
toolBarSafetyLabel
);
toolBarModeLabel
=
new
QLabel
(
"------"
,
this
);
toolBarModeLabel
->
setStyleSheet
(
"QLabel { margin: 0px 2px; font: 14px; color: #3C7B9E; }"
);
toolBarModeLabel
->
setToolTip
(
tr
(
"Vehicle mode"
));
addWidget
(
toolBarModeLabel
);
toolBarStateLabel
=
new
QLabel
(
"------"
,
this
);
toolBarStateLabel
->
setStyleSheet
(
"QLabel { margin: 0px 2px; font: 14px; color: #FEC654; }"
);
toolBarWpLabel
=
new
QLabel
(
"WP--"
,
this
);
toolBarWpLabel
->
setStyleSheet
(
"QLabel { margin: 0px 2px; font: 18px; color: #3C7B9E; }"
);
toolBarDistLabel
=
new
QLabel
(
"--- ---- m"
,
this
);
toolBarMessageLabel
=
new
QLabel
(
"No system messages."
,
this
);
toolBarMessageLabel
->
setStyleSheet
(
"QLabel { margin: 0px 4px; font: 12px; font-style: italic; color: #3C7B9E; }"
);
toolBarStateLabel
->
setToolTip
(
tr
(
"Vehicle state"
));
addWidget
(
toolBarStateLabel
);
toolBarBatteryBar
=
new
QProgressBar
(
this
);
toolBarBatteryBar
->
setStyleSheet
(
"QProgressBar:horizontal { margin: 0px 4px 0px 0px; border: 1px solid #4A4A4F; border-radius: 4px; text-align: center; padding: 2px; color: #111111; background-color: #111118; height: 10px; } QProgressBar:horizontal QLabel { font-size: 9px; color: #111111; } QProgressBar::chunk { background-color: green; }"
);
toolBarBatteryBar
->
setMinimum
(
0
);
...
...
@@ -74,26 +84,34 @@ QGCToolBar::QGCToolBar(QWidget *parent) :
toolBarBatteryBar
->
setMinimumWidth
(
20
);
toolBarBatteryBar
->
setMaximumWidth
(
100
);
toolBarBatteryBar
->
setToolTip
(
tr
(
"Battery charge level"
));
addWidget
(
toolBarBatteryBar
);
toolBarBatteryVoltageLabel
=
new
QLabel
(
"xx.x V"
);
toolBarBatteryVoltageLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 0px 0px 0px 4px; font: 14px; color: %1; }"
).
arg
(
QColor
(
Qt
::
green
).
name
()));
symbolButton
->
setStyleSheet
(
"QWidget { background-color: #050508; color: #DDDDDF; background-clip: border; } QToolButton { font-weight: bold; font-size: 12px; border: 0px solid #999999; border-radius: 5px; min-width:22px; max-width: 22px; min-height: 22px; max-height: 22px; padding: 0px; margin: 0px 0px 0px 20px; background-color: none; }"
);
addWidget
(
symbolButton
);
addWidget
(
toolBarNameLabel
);
addWidget
(
toolBarSafetyLabel
);
addWidget
(
toolBarModeLabel
);
addWidget
(
toolBarStateLabel
);
addWidget
(
toolBarBatteryBar
);
toolBarBatteryVoltageLabel
->
setToolTip
(
tr
(
"Battery voltage"
));
addWidget
(
toolBarBatteryVoltageLabel
);
toolBarWpLabel
=
new
QLabel
(
"WP--"
,
this
);
toolBarWpLabel
->
setStyleSheet
(
"QLabel { margin: 0px 2px; font: 18px; color: #3C7B9E; }"
);
toolBarWpLabel
->
setToolTip
(
tr
(
"Current mission"
));
addWidget
(
toolBarWpLabel
);
toolBarDistLabel
=
new
QLabel
(
"--- ---- m"
,
this
);
toolBarDistLabel
->
setToolTip
(
tr
(
"Distance to current mission"
));
addWidget
(
toolBarDistLabel
);
toolBarMessageLabel
=
new
QLabel
(
"No system messages."
,
this
);
toolBarMessageLabel
->
setStyleSheet
(
"QLabel { margin: 0px 4px; font: 12px; font-style: italic; color: #3C7B9E; }"
);
toolBarMessageLabel
->
setToolTip
(
tr
(
"Most recent system message"
));
addWidget
(
toolBarMessageLabel
);
//addWidget(new QSpacerItem(20, 0, QSizePolicy::Expanding));
// DONE INITIALIZING BUTTONS
// Configure the toolbar for the current default UAS
setActiveUAS
(
UASManager
::
instance
()
->
getActiveUAS
());
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
// Set the toolbar to be updated every 2s
connect
(
&
updateViewTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
updateView
()));
updateViewTimer
.
start
(
2000
);
}
...
...
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