diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2021-10-07 11:57:29 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2021-10-07 16:06:07 +0000 |
commit | 0786e967ddb52a2c744576ae9dbc7ec4844b9581 (patch) | |
tree | f5dc996a53450a49432b28d5b06440b28cd24995 | |
parent | 19b59f88d247b49b4a20609eeaee3cb972cfdf35 (diff) |
Core: Prevent contents of Popups being styled as "panelwidgets"
Content of widgets with windowType Qt::Dialog was already excluded from
being styled as "panelwidgets". This change adds Qt::Popup to the
blacklist.
Task-number: QTCREATORBUG-26370
Change-Id: I76d07da4d8f3ae9f1c8235cdc072a04917454065
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/plugins/coreplugin/manhattanstyle.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 9a8934b989..50837d9f15 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<const FancyMainWindow *>(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; |