diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2020-07-22 17:46:58 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2020-07-23 10:28:48 +0000 |
commit | e0915b7eff32bc80d26dc9531b91e30c4384f102 (patch) | |
tree | 3d7d6d44f3b31626e806068162c33938a42d5f95 /src/plugins/android/androidsettingswidget.cpp | |
parent | 8a8453e55d3bef1dae9212f7e957852b93ade00a (diff) |
Android: Fix rendering of settings background in dark mode
This amends faad83d5a37448b472af2efa76b7193c83f2c1f1 by undoing the
insertion of a QScrollArea + QWidget under the whole form. The reason
for adding this was to be able to scroll down to the license agreements.
Since Core::SettingsDialog already puts the settings widget into a
QScrollArea, we have two of those and one is superfluous. When using a
dark theme (e.g. flat-dark), this extra QScrollArea introduces wrong
background color. Also, it complicates the already quite blown
androidsettingswidget.ui
This change removes the QSrollArea + QWidget while keeping the feature
of scrolling to the license text. This is achieved by searching through
the parent chain for a QScrollArea and using the first found one for
scrolling.
Task-number: QTCREATORBUG-24379
Change-Id: I2bdae9367eb06b68fa47badf2556eb1ec7ebcafb
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Diffstat (limited to 'src/plugins/android/androidsettingswidget.cpp')
-rw-r--r-- | src/plugins/android/androidsettingswidget.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/android/androidsettingswidget.cpp b/src/plugins/android/androidsettingswidget.cpp index f2f6b0208ff..7c7bed2d926 100644 --- a/src/plugins/android/androidsettingswidget.cpp +++ b/src/plugins/android/androidsettingswidget.cpp @@ -56,6 +56,7 @@ #include <QLoggingCategory> #include <QMessageBox> #include <QModelIndex> +#include <QScrollArea> #include <QSettings> #include <QString> #include <QTimer> @@ -367,7 +368,14 @@ AndroidSettingsWidget::AndroidSettingsWidget() m_ui.managerTabWidget->tabBar()->setEnabled(true); }); connect(m_sdkManagerWidget, &AndroidSdkManagerWidget::licenseWorkflowStarted, [this] { - m_ui.scrollArea->ensureWidgetVisible(m_ui.managerTabWidget); + QObject *parentWidget = parent(); + while (parentWidget) { + if (auto scrollArea = qobject_cast<QScrollArea *>(parentWidget)) { + scrollArea->ensureWidgetVisible(m_ui.managerTabWidget); + break; + } + parentWidget = parentWidget->parent(); + }; }); QMap<int, QString> javaValidationPoints; |