aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmldesigner/documentwarningwidget.cpp
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2016-10-07 13:50:17 +0200
committerThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-10-07 19:53:17 +0000
commit2e81a39b7c0997300ff87905e86a56a0972a5fc1 (patch)
tree36c2c8f670cf23ae9c60bf9fd25a721f3b8db10d /src/plugins/qmldesigner/documentwarningwidget.cpp
parent572b5447ffe7edbdffa91d449010032c4a0fe5d8 (diff)
QmlDesigner: Remove transparency from DocumentWarningWidget
The ToolTipBase has alpha in some themes (e.g. Flat Dark). If the background of the DocumentWarningWidget is transparent, this looks buggy. We remove the transparency by blending the color against the background color. Change-Id: I4a25a30700b3ee1e9e8d23d0b0bad09f297f0605 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/documentwarningwidget.cpp')
-rw-r--r--src/plugins/qmldesigner/documentwarningwidget.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/qmldesigner/documentwarningwidget.cpp b/src/plugins/qmldesigner/documentwarningwidget.cpp
index 12baccb7b1..50ea460b13 100644
--- a/src/plugins/qmldesigner/documentwarningwidget.cpp
+++ b/src/plugins/qmldesigner/documentwarningwidget.cpp
@@ -27,6 +27,10 @@
#include <qmldesignerplugin.h>
+
+#include <utils/theme/theme.h>
+#include <utils/stylehelper.h>
+
#include <QLabel>
#include <QPushButton>
#include <QCheckBox>
@@ -170,6 +174,13 @@ bool DocumentWarningWidget::eventFilter(QObject *object, QEvent *event)
void DocumentWarningWidget::showEvent(QShowEvent *event)
{
+ const QColor backgroundColor = Utils::creatorTheme()->color(Utils::Theme::QmlDesigner_BackgroundColor);
+ QPalette pal = palette();
+ QColor color = pal.color(QPalette::ToolTipBase);
+ const QColor backgroundNoAlpha = Utils::StyleHelper::alphaBlendedColors(color, backgroundColor);
+ color.setAlpha(255);
+ pal.setColor(QPalette::ToolTipBase, backgroundNoAlpha);
+ setPalette(pal);
m_gotoCodeWasClicked = false;
moveToParentCenter();
refreshContent();