diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 9a8934b989f..50837d9f153 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -73,14 +73,20 @@ bool styleEnabled(const QWidget *widget) return true; } +static bool isInDialogOrPopup(const QWidget *widget) +{ + // Do not style dialogs or explicitly ignored widgets + const Qt::WindowType windowType = widget->window()->windowType(); + return (windowType == Qt::Dialog || windowType == Qt::Popup); +} + // Consider making this a QStyle state bool panelWidget(const QWidget *widget) { if (!widget) return false; - // Do not style dialogs or explicitly ignored widgets - if ((widget->window()->windowFlags() & Qt::WindowType_Mask) == Qt::Dialog) + if (isInDialogOrPopup(widget)) return false; if (qobject_cast(widget)) @@ -107,8 +113,7 @@ bool lightColored(const QWidget *widget) if (!widget) return false; - // Don't style dialogs or explicitly ignored widgets - if ((widget->window()->windowFlags() & Qt::WindowType_Mask) == Qt::Dialog) + if (isInDialogOrPopup(widget)) return false; const QWidget *p = widget;