From a0270cca1509d73ed95367f7ea70837a23a24628 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Fri, 24 Oct 2014 15:10:52 +0200 Subject: [PATCH] OP-1568 Fixes transparent background issue that causes black tooltip - Telemetry monitor a little bigger --- .../src/plugins/telemetry/monitorwidget.cpp | 4 +++- .../src/plugins/telemetry/telemetryplugin.cpp | 10 +--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/telemetry/monitorwidget.cpp b/ground/openpilotgcs/src/plugins/telemetry/monitorwidget.cpp index b3ece0e10..3f9dcfb20 100644 --- a/ground/openpilotgcs/src/plugins/telemetry/monitorwidget.cpp +++ b/ground/openpilotgcs/src/plugins/telemetry/monitorwidget.cpp @@ -98,7 +98,7 @@ QGraphicsTextItem *createTextItem(QGraphicsSvgItem *parent, QString elementId, Q MonitorWidget::MonitorWidget(QWidget *parent) : QGraphicsView(parent), aspectRatioMode(Qt::KeepAspectRatio) { - setMinimumSize(180, 25); + setMinimumSize(195, 25); QGraphicsScene *scene = new QGraphicsScene(); @@ -110,6 +110,8 @@ MonitorWidget::MonitorWidget(QWidget *parent) : setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); + setStyleSheet("QGraphicsView{background:transparent;}"); + setBackgroundBrush(QBrush(Utils::StyleHelper::baseColor())); setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing); diff --git a/ground/openpilotgcs/src/plugins/telemetry/telemetryplugin.cpp b/ground/openpilotgcs/src/plugins/telemetry/telemetryplugin.cpp index 14d136def..07725ea35 100644 --- a/ground/openpilotgcs/src/plugins/telemetry/telemetryplugin.cpp +++ b/ground/openpilotgcs/src/plugins/telemetry/telemetryplugin.cpp @@ -68,20 +68,12 @@ bool TelemetryPlugin::initialize(const QStringList & args, QString *errMsg) // TODO not so good... g is probalby leaked... MonitorWidget *w = mf->createMonitorWidget(NULL); - w->setMaximumWidth(180); - - // - // setAlignment(Qt::AlignCenter); + w->setMaximumWidth(195); // no border w->setFrameStyle(QFrame::NoFrame); w->setWindowFlags(Qt::FramelessWindowHint); - // set svg background translucent - w->setStyleSheet("background:transparent;"); - // set widget background translucent - w->setAttribute(Qt::WA_TranslucentBackground); - w->setBackgroundBrush(Qt::NoBrush); // add monitor widget to connection manager