forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -73,14 +73,20 @@ bool styleEnabled(const QWidget *widget)
|
|||||||
return true;
|
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
|
// Consider making this a QStyle state
|
||||||
bool panelWidget(const QWidget *widget)
|
bool panelWidget(const QWidget *widget)
|
||||||
{
|
{
|
||||||
if (!widget)
|
if (!widget)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Do not style dialogs or explicitly ignored widgets
|
if (isInDialogOrPopup(widget))
|
||||||
if ((widget->window()->windowFlags() & Qt::WindowType_Mask) == Qt::Dialog)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (qobject_cast<const FancyMainWindow *>(widget))
|
if (qobject_cast<const FancyMainWindow *>(widget))
|
||||||
@@ -107,8 +113,7 @@ bool lightColored(const QWidget *widget)
|
|||||||
if (!widget)
|
if (!widget)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Don't style dialogs or explicitly ignored widgets
|
if (isInDialogOrPopup(widget))
|
||||||
if ((widget->window()->windowFlags() & Qt::WindowType_Mask) == Qt::Dialog)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const QWidget *p = widget;
|
const QWidget *p = widget;
|
||||||
|
Reference in New Issue
Block a user