@@ -338,30 +338,32 @@ QRegion BlurHelper::blurTabWidgetRegion(QWidget *widget) const
338338QRegion BlurHelper::blurSettingsDialogRegion (QWidget *widget) const
339339{
340340 QRegion region;
341- QList<QWidget *> widgets = widget->findChildren <QWidget *>();
342341
343342 // settings only change it for konsole or dolphin about window
344343 if ((widget->windowFlags () & Qt::WindowType_Mask) == Qt::Dialog
345344 && (widget->inherits (" KAboutApplicationDialog" ) || widget->inherits (" KDEPrivate::KAboutKdeDialog" ))) {
346- for (auto w : widgets) {
347- if (qobject_cast<QTabWidget *>(w) && (widget->inherits (" KAboutApplicationDialog" ) || widget->inherits (" KDEPrivate::KAboutKdeDialog" ))) {
348- // about dialog
349- const QTabWidget *tw = qobject_cast<QTabWidget *>(w);
350- QSize tbSize (tw->rect ().size ());
351- // the blur region is too small without adjusting the height of the tabbar height
352- tbSize.setHeight (tw->tabBar ()->rect ().height () + 4 );
353- region += roundedRegion (QRect (tw->pos (), tbSize), StyleConfigData::cornerRadius (), false , false , true , false );
354- } else {
355- // settings main dialog
356- region += roundedRegion (QRect (w->mapToGlobal (w->pos ()), w->rect ().size ()), StyleConfigData::cornerRadius (), false , false , true , false );
357- }
358- if (w->inherits (" KPageWidget" )) {
359- // sidebar
360- QList<QWidget *> KPageWidgets = w->findChildren <QWidget *>(QString (), Qt::FindDirectChildrenOnly);
361- for (auto wid : KPageWidgets) {
362- if (wid->property (PropertyNames::sidePanelView).toBool ()) {
363- region += roundedRegion (QRect (wid->pos (), wid->rect ().size ()), StyleConfigData::cornerRadius (), false , false , true , false );
364- break ;
345+ QList<QWidget *> widgets = widget->findChildren <QWidget *>();
346+ if (widgets.length () > 0 ) {
347+ for (auto w : widgets) {
348+ if (qobject_cast<QTabWidget *>(w) && (widget->inherits (" KAboutApplicationDialog" ) || widget->inherits (" KDEPrivate::KAboutKdeDialog" ))) {
349+ // about dialog
350+ const QTabWidget *tw = qobject_cast<QTabWidget *>(w);
351+ QSize tbSize (tw->rect ().size ());
352+ // the blur region is too small without adjusting the height of the tabbar height
353+ tbSize.setHeight (tw->tabBar ()->rect ().height () + 4 );
354+ region += roundedRegion (QRect (tw->pos (), tbSize), StyleConfigData::cornerRadius (), false , false , true , false );
355+ } else {
356+ // settings main dialog
357+ region += roundedRegion (QRect (w->mapToGlobal (w->pos ()), w->rect ().size ()), StyleConfigData::cornerRadius (), false , false , true , false );
358+ }
359+ if (w->inherits (" KPageWidget" )) {
360+ // sidebar
361+ QList<QWidget *> KPageWidgets = w->findChildren <QWidget *>(QString (), Qt::FindDirectChildrenOnly);
362+ for (auto wid : KPageWidgets) {
363+ if (wid->property (PropertyNames::sidePanelView).toBool ()) {
364+ region += roundedRegion (QRect (wid->pos (), wid->rect ().size ()), StyleConfigData::cornerRadius (), false , false , true , false );
365+ break ;
366+ }
365367 }
366368 }
367369 }
0 commit comments