1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

Use the "User Interface Colour" defined in the general settings as the background color of the

various dial widgets and PFD, make the GCS look and feel more coherent.



git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1130 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
edouard 2010-07-17 22:47:42 +00:00 committed by edouard
parent e5c19a38c5
commit 3335be3fd9
4 changed files with 9 additions and 2 deletions

View File

@ -27,6 +27,7 @@
*/
#include "dialgadgetwidget.h"
#include <utils/stylehelper.h>
#include <iostream>
#include <QDebug>
@ -164,6 +165,7 @@ void DialGadgetWidget::setDialFile(QString dfn, QString bg, QString fg, QString
n2enabled = false;
n3enabled = false;
QGraphicsScene *l_scene = scene();
setBackgroundBrush(QBrush(Utils::StyleHelper::baseColor()));
if (QFile::exists(dfn) && m_renderer->load(dfn) && m_renderer->isValid())
{
l_scene->clear(); // This also deletes all items contained in the scene.

View File

@ -26,8 +26,7 @@
*/
#include "lineardialgadgetwidget.h"
#include <iostream>
#include <utils/stylehelper.h>
#include <QtGui/QFileDialog>
#include <QDebug>
@ -135,6 +134,7 @@ void LineardialGadgetWidget::updateIndex(UAVObject *object1) {
void LineardialGadgetWidget::setDialFile(QString dfn)
{
QGraphicsScene *l_scene = scene();
setBackgroundBrush(QBrush(Utils::StyleHelper::baseColor()));
if (QFile::exists(dfn) && m_renderer->load(dfn) && m_renderer->isValid() )
{
l_scene->clear(); // Beware: clear also deletes all objects

View File

@ -26,6 +26,7 @@
*/
#include "pfdgadgetwidget.h"
#include <utils/stylehelper.h>
#include <iostream>
#include <QDebug>
#include <cmath>
@ -280,6 +281,7 @@ void PFDGadgetWidget::updateBattery(UAVObject *object1) {
void PFDGadgetWidget::setDialFile(QString dfn)
{
QGraphicsScene *l_scene = scene();
setBackgroundBrush(QBrush(Utils::StyleHelper::baseColor()));
if (QFile::exists(dfn) && m_renderer->load(dfn) && m_renderer->isValid())
{
/* The PFD element IDs are fixed, not like with the analog dial.

View File

@ -26,6 +26,7 @@
*/
#include "systemhealthgadgetwidget.h"
#include "utils/stylehelper.h"
#include "extensionsystem/pluginmanager.h"
#include "uavobjects/uavobjectmanager.h"
#include "uavobjects/systemalarms.h"
@ -42,6 +43,7 @@ SystemHealthGadgetWidget::SystemHealthGadgetWidget(QWidget *parent) : QGraphicsV
setMinimumSize(128,128);
setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
setScene(new QGraphicsScene(this));
m_renderer = new QSvgRenderer();
background = new QGraphicsSvgItem();
@ -106,6 +108,7 @@ SystemHealthGadgetWidget::~SystemHealthGadgetWidget()
void SystemHealthGadgetWidget::setSystemFile(QString dfn)
{
setBackgroundBrush(QBrush(Utils::StyleHelper::baseColor()));
if (QFile::exists(dfn))
{
m_renderer->load(dfn);