From 2e81a39b7c0997300ff87905e86a56a0972a5fc1 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 7 Oct 2016 13:50:17 +0200 Subject: [PATCH] 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 --- src/plugins/qmldesigner/documentwarningwidget.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/plugins/qmldesigner/documentwarningwidget.cpp b/src/plugins/qmldesigner/documentwarningwidget.cpp index 12baccb7b18..50ea460b131 100644 --- a/src/plugins/qmldesigner/documentwarningwidget.cpp +++ b/src/plugins/qmldesigner/documentwarningwidget.cpp @@ -27,6 +27,10 @@ #include + +#include +#include + #include #include #include @@ -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();