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
7c57e2e5
Commit
7c57e2e5
authored
May 13, 2013
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed visual bug on status bar
parent
3325c274
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
13 deletions
+19
-13
MainWindow.cc
src/ui/MainWindow.cc
+6
-5
QGCStatusBar.cc
src/ui/QGCStatusBar.cc
+7
-2
QGCToolBar.cc
src/ui/QGCToolBar.cc
+6
-6
No files found.
src/ui/MainWindow.cc
View file @
7c57e2e5
...
...
@@ -104,9 +104,14 @@ MainWindow::MainWindow(QWidget *parent):
lowPowerMode
(
false
)
{
hide
();
isAdvancedMode
=
false
;
emit
initStatusChanged
(
"Loading UI Settings.."
);
loadSettings
();
emit
initStatusChanged
(
"Loading Style."
);
loadStyle
(
currentStyle
);
if
(
settings
.
contains
(
"ADVANCED_MODE"
))
{
isAdvancedMode
=
settings
.
value
(
"ADVANCED_MODE"
).
toBool
();
...
...
@@ -132,9 +137,6 @@ MainWindow::MainWindow(QWidget *parent):
settings
.
sync
();
emit
initStatusChanged
(
"Loading Style."
);
loadStyle
(
currentStyle
);
emit
initStatusChanged
(
"Setting up user interface."
);
// Setup user interface
...
...
@@ -175,12 +177,12 @@ MainWindow::MainWindow(QWidget *parent):
advancedActions
<<
ui
.
actionEngineersView
;
toolBar
->
setPerspectiveChangeAdvancedActions
(
advancedActions
);
customStatusBar
=
new
QGCStatusBar
(
this
);
setStatusBar
(
customStatusBar
);
statusBar
()
->
setSizeGripEnabled
(
true
);
emit
initStatusChanged
(
"Building common widgets."
);
buildCommonWidgets
();
...
...
@@ -394,7 +396,6 @@ void MainWindow::buildCommonWidgets()
logPlayer
=
new
QGCMAVLinkLogPlayer
(
mavlink
,
customStatusBar
);
customStatusBar
->
setLogPlayer
(
logPlayer
);
// Center widgets
if
(
!
plannerView
)
{
...
...
src/ui/QGCStatusBar.cc
View file @
7c57e2e5
...
...
@@ -44,12 +44,17 @@ QGCStatusBar::QGCStatusBar(QWidget *parent) :
loadSettings
();
setStyleSheet
(
"Q
Widget {border-color: transparent; } QStatusBar {border-color: transparent; border: 0px; border-bottom: 1px solid #101010; border-top: 1px solid #4F4F4F; background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4B4B4B, stop:0.3 #404040, stop:0.34 #383838, stop:1 #181818);}
"
);
setStyleSheet
(
"Q
StatusBar { border: 0px; border-bottom: 1px solid #101010; border-top: 1px solid #4F4F4F; background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1, stop:0 #4B4B4B, stop:0.3 #404040, stop:0.34 #383838, stop:1 #181818); }
"
);
}
void
QGCStatusBar
::
paintEvent
(
QPaintEvent
*
event
)
{
// if (currentMessage().length() != 0) {
QPainter
p
(
this
);
QStyleOption
opt
;
opt
.
initFrom
(
this
);
style
()
->
drawPrimitive
(
QStyle
::
PE_PanelStatusBar
,
&
opt
,
&
p
,
this
);
//QStatusBar::paintEvent(event);
// if (currentMessage().length() == 0) {
// QStatusBar::paintEvent(event);
// } else {
...
...
src/ui/QGCToolBar.cc
View file @
7c57e2e5
...
...
@@ -54,11 +54,11 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms)
// Alternate colors to increase visibility
if
((
ms
/
1000
)
%
2
==
0
)
{
toolBarTimeoutLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}"
).
arg
(
QGC
::
colorDarkWhite
.
name
()).
arg
(
QGC
::
colorMagenta
.
name
()));
toolBarTimeoutLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 3px 2px;
padding: 2px; padding-left: 4px; padding-right: 4px;
font: 14px; color: %1; background-color: %2; border-radius: 4px;}"
).
arg
(
QGC
::
colorDarkWhite
.
name
()).
arg
(
QGC
::
colorMagenta
.
name
()));
}
else
{
toolBarTimeoutLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}"
).
arg
(
QGC
::
colorDarkWhite
.
name
()).
arg
(
QGC
::
colorMagenta
.
dark
(
250
).
name
()));
toolBarTimeoutLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 3px 2px;
padding: 2px; padding-left: 4px; padding-right: 4px;
font: 14px; color: %1; background-color: %2; border-radius: 4px;}"
).
arg
(
QGC
::
colorDarkWhite
.
name
()).
arg
(
QGC
::
colorMagenta
.
dark
(
250
).
name
()));
}
toolBarTimeoutLabel
->
setText
(
tr
(
"CONNECTION LOST: %1 s"
).
arg
((
ms
/
1000.0
f
),
2
,
'f'
,
1
,
' '
));
}
...
...
@@ -91,12 +91,12 @@ void QGCToolBar::createUI()
toolBarTimeoutLabel
=
new
QLabel
(
"UNCONNECTED"
,
this
);
toolBarTimeoutLabel
->
setToolTip
(
tr
(
"System timed out, interval since last message"
));
toolBarTimeoutLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}"
).
arg
(
QGC
::
colorDarkWhite
.
name
()).
arg
(
QGC
::
colorMagenta
.
name
()));
toolBarTimeoutLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 3px 2px;
padding: 2px; padding-left: 4px; padding-right: 4px;
font: 14px; color: %1; background-color: %2; border-radius: 4px;}"
).
arg
(
QGC
::
colorDarkWhite
.
name
()).
arg
(
QGC
::
colorMagenta
.
name
()));
toolBarTimeoutLabel
->
setAlignment
(
Qt
::
AlignCenter
);
addWidget
(
toolBarTimeoutLabel
);
toolBarSafetyLabel
=
new
QLabel
(
"SAFE"
,
this
);
toolBarSafetyLabel
->
setStyleSheet
(
"QLabel { margin: 3px 2px; font: 14px; color: #14C814; }"
);
toolBarSafetyLabel
->
setStyleSheet
(
"QLabel { margin: 3px 2px;
padding: 2px; padding-left: 4px; padding-right: 4px;
font: 14px; color: #14C814; }"
);
toolBarSafetyLabel
->
setToolTip
(
tr
(
"Vehicle safety state"
));
toolBarSafetyLabel
->
setAlignment
(
Qt
::
AlignCenter
);
addWidget
(
toolBarSafetyLabel
);
...
...
@@ -353,12 +353,12 @@ void QGCToolBar::updateView()
if
(
systemArmed
)
{
toolBarSafetyLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 3px 2px; font: 14px; color: %1; background-color: %2; border-radius: 4px;}"
).
arg
(
QGC
::
colorRed
.
name
()).
arg
(
QGC
::
colorYellow
.
name
()));
toolBarSafetyLabel
->
setStyleSheet
(
QString
(
"QLabel { margin: 3px 2px;
padding: 2px; padding-left: 4px; padding-right: 4px;
font: 14px; color: %1; background-color: %2; border-radius: 4px;}"
).
arg
(
QGC
::
colorRed
.
name
()).
arg
(
QGC
::
colorYellow
.
name
()));
toolBarSafetyLabel
->
setText
(
tr
(
"ARMED"
));
}
else
{
toolBarSafetyLabel
->
setStyleSheet
(
"QLabel { margin: 3px 2px; font: 14px; color: #14C814; }"
);
toolBarSafetyLabel
->
setStyleSheet
(
"QLabel { margin: 3px 2px;
padding: 2px; padding-left: 4px; padding-right: 4px;
font: 14px; color: #14C814; }"
);
toolBarSafetyLabel
->
setText
(
tr
(
"SAFE"
));
}
...
...
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