Commit 98936a41 authored by Lorenz Meier's avatar Lorenz Meier

Minor UI fixes

parent eb5a54c0
...@@ -30,6 +30,7 @@ This file is part of the QGROUNDCONTROL project ...@@ -30,6 +30,7 @@ This file is part of the QGROUNDCONTROL project
*/ */
#include <QPainter> #include <QPainter>
#include <QSettings> #include <QSettings>
#include <QScrollBar>
#include "DebugConsole.h" #include "DebugConsole.h"
#include "ui_DebugConsole.h" #include "ui_DebugConsole.h"
...@@ -313,9 +314,15 @@ void DebugConsole::receiveTextMessage(int id, int component, int severity, QStri ...@@ -313,9 +314,15 @@ void DebugConsole::receiveTextMessage(int id, int component, int severity, QStri
break; break;
} }
//turn off updates while we're appending content to avoid breaking the autoscroll behavior
m_ui->receiveText->setUpdatesEnabled(false);
QScrollBar *scroller = m_ui->receiveText->verticalScrollBar();
m_ui->receiveText->appendHtml(QString("<font color=\"%1\">(%2:%3) %4</font>\n").arg(UASManager::instance()->getUASForId(id)->getColor().name(), name, comp, text)); m_ui->receiveText->appendHtml(QString("<font color=\"%1\">(%2:%3) %4</font>\n").arg(UASManager::instance()->getUASForId(id)->getColor().name(), name, comp, text));
// Ensure text area scrolls correctly // Ensure text area scrolls correctly
m_ui->receiveText->ensureCursorVisible(); scroller->setValue(scroller->maximum());
m_ui->receiveText->setUpdatesEnabled(true);
} }
} }
......
...@@ -75,6 +75,8 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms) ...@@ -75,6 +75,8 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms)
} }
toolBarTimeoutLabel->setText(tr("CONNECTION LOST: %1 s").arg((ms / 1000.0f), 2, 'f', 1, ' ')); toolBarTimeoutLabel->setText(tr("CONNECTION LOST: %1 s").arg((ms / 1000.0f), 2, 'f', 1, ' '));
toolBarTimeoutAction->setVisible(true); toolBarTimeoutAction->setVisible(true);
toolBarMessageLabel->hide();
} }
else else
{ {
...@@ -82,6 +84,8 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms) ...@@ -82,6 +84,8 @@ void QGCToolBar::heartbeatTimeout(bool timeout, unsigned int ms)
if (toolBarTimeoutAction->isVisible()) if (toolBarTimeoutAction->isVisible())
{ {
toolBarTimeoutAction->setVisible(false); toolBarTimeoutAction->setVisible(false);
toolBarMessageLabel->show();
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment