forked from qt-creator/qt-creator
Utils: Fix the applying of new base color at run-time
If the base color was changed via the color picker that opens with shift-click on the upper left toolbar area, some widgets were not instantly updated with the new color. This change ensures that all (visible) widgets instead of just all top level windows get updated after changing the color. While this method is potentially more expensive, it does not effect the start-up negatively, because on start-up StyleHelper::setBaseColor() gets called before the mainwindow is shown. Fixes: QTCREATORBUG-29135 Change-Id: I227c2f243ffcd9f8210b9d2d1a47ad0494663d50 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -190,7 +190,7 @@ void StyleHelper::setBaseColor(const QColor &newcolor)
|
||||
|
||||
if (color.isValid() && color != m_baseColor) {
|
||||
m_baseColor = color;
|
||||
const QList<QWidget *> widgets = QApplication::topLevelWidgets();
|
||||
const QWidgetList widgets = QApplication::allWidgets();
|
||||
for (QWidget *w : widgets)
|
||||
w->update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user