if the graphicswidget isn't on a corona, use the applet's scene

This commit is contained in:
Aaron Seigo 2011-11-22 13:56:35 +01:00
parent 9775682bef
commit 7ed45afaaf

View File

@ -341,8 +341,8 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
q->resize(prefSize);
emit q->appletTransformedItself();
}
//Applet on popup
} else {
//Applet on popup
if (icon && lay) {
lay->addItem(icon);
}
@ -363,7 +363,6 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
delete proxy.data();
}
if (!dialogPtr) {
//save the aspect ratio mode in case we drag'n drop in the Desktop later
savedAspectRatio = q->aspectRatioMode();
@ -387,13 +386,16 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
if (gWidget) {
Corona *corona = qobject_cast<Corona *>(gWidget->scene());
if (!corona) {
corona = qobject_cast<Corona *>(q->scene());
}
if (corona) {
corona->addOffscreenWidget(gWidget);
}
gWidget->show();
dialog->setGraphicsWidget(gWidget);
//gWidget->resize(gWidget->preferredSize());
dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (gWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
} else if (qWidget) {
QVBoxLayout *l_layout = new QVBoxLayout(dialog);
@ -414,7 +416,6 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
QObject::connect(dialog, SIGNAL(dialogVisible(bool)), q, SLOT(dialogStatusChanged(bool)));
}
}
}
if (constraints & Plasma::PopupConstraint) {
updateDialogPosition();