forked from qt-creator/qt-creator
Core: Allow dialogs and popups be styled as "panelwidgets"
A recent change that prevented popups from being styled as "panelwidget"
unintentionally removed the styling from the upper part of the mini
target chooser.
This change re-allows styling contents of popups (and dialogs) if they
have the "panelwidget" property set to true.
Amends: 0786e967dd
Fixes: QTCREATORBUG-26403
Change-Id: Ib85b06d0a2823a5caf736d1354cf025a6ddd475c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -73,10 +73,13 @@ bool styleEnabled(const QWidget *widget)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isInDialogOrPopup(const QWidget *widget)
|
static bool isInUnstyledDialogOrPopup(const QWidget *widget)
|
||||||
{
|
{
|
||||||
// Do not style dialogs or explicitly ignored widgets
|
// Do not style contents of dialogs or popups without "panelwidget" property
|
||||||
const Qt::WindowType windowType = widget->window()->windowType();
|
const QWidget *window = widget->window();
|
||||||
|
if (window->property("panelwidget").toBool())
|
||||||
|
return false;
|
||||||
|
const Qt::WindowType windowType = window->windowType();
|
||||||
return (windowType == Qt::Dialog || windowType == Qt::Popup);
|
return (windowType == Qt::Dialog || windowType == Qt::Popup);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +89,7 @@ bool panelWidget(const QWidget *widget)
|
|||||||
if (!widget)
|
if (!widget)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (isInDialogOrPopup(widget))
|
if (isInUnstyledDialogOrPopup(widget))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (qobject_cast<const FancyMainWindow *>(widget))
|
if (qobject_cast<const FancyMainWindow *>(widget))
|
||||||
@@ -113,7 +116,7 @@ bool lightColored(const QWidget *widget)
|
|||||||
if (!widget)
|
if (!widget)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (isInDialogOrPopup(widget))
|
if (isInUnstyledDialogOrPopup(widget))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const QWidget *p = widget;
|
const QWidget *p = widget;
|
||||||
|
|||||||
Reference in New Issue
Block a user