Merge remote-tracking branch 'origin/KDE/4.7' into frameworks
Conflicts: plasma/popupapplet.cpp
This commit is contained in:
commit
685ae3b6c5
100
popupapplet.cpp
100
popupapplet.cpp
@ -308,8 +308,8 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
|||||||
q->resize(prefSize);
|
q->resize(prefSize);
|
||||||
emit q->appletTransformedItself();
|
emit q->appletTransformedItself();
|
||||||
}
|
}
|
||||||
//Applet on popup
|
|
||||||
} else {
|
} else {
|
||||||
|
//Applet on popup
|
||||||
if (icon && lay) {
|
if (icon && lay) {
|
||||||
lay->addItem(icon);
|
lay->addItem(icon);
|
||||||
}
|
}
|
||||||
@ -330,56 +330,57 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
|||||||
delete proxy.data();
|
delete proxy.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!dialogPtr) {
|
//save the aspect ratio mode in case we drag'n drop in the Desktop later
|
||||||
//save the aspect ratio mode in case we drag'n drop in the Desktop later
|
savedAspectRatio = q->aspectRatioMode();
|
||||||
savedAspectRatio = q->aspectRatioMode();
|
|
||||||
|
|
||||||
if (icon) {
|
if (icon) {
|
||||||
icon->show();
|
icon->show();
|
||||||
q->setAspectRatioMode(Plasma::ConstrainedSquare);
|
q->setAspectRatioMode(Plasma::ConstrainedSquare);
|
||||||
}
|
|
||||||
|
|
||||||
Dialog *dialog = new Dialog();
|
|
||||||
dialog->d->appletPtr = q;
|
|
||||||
dialogPtr = dialog;
|
|
||||||
|
|
||||||
if (icon) {
|
|
||||||
dialog->setAspectRatioMode(savedAspectRatio);
|
|
||||||
}
|
|
||||||
|
|
||||||
//no longer use Qt::Popup since that seems to cause a lot of problem when you drag
|
|
||||||
//stuff out of your Dialog. Monitor WindowDeactivate events so we can
|
|
||||||
//emulate the same kind of behavior as Qt::Popup (close when you click somewhere
|
|
||||||
//else.
|
|
||||||
|
|
||||||
if (gWidget) {
|
|
||||||
Corona *corona = qobject_cast<Corona *>(gWidget->scene());
|
|
||||||
|
|
||||||
if (corona) {
|
|
||||||
corona->addOffscreenWidget(gWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
l_layout->setSpacing(0);
|
|
||||||
l_layout->setMargin(0);
|
|
||||||
l_layout->addWidget(qWidget);
|
|
||||||
dialog->adjustSize();
|
|
||||||
dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (qWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
|
|
||||||
} else {
|
|
||||||
dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
|
|
||||||
}
|
|
||||||
|
|
||||||
restoreDialogSize();
|
|
||||||
KWindowSystem::setState(dialog->winId(), NET::SkipTaskbar | NET::SkipPager);
|
|
||||||
dialog->installEventFilter(q);
|
|
||||||
|
|
||||||
QObject::connect(dialog, SIGNAL(dialogResized()), q, SLOT(dialogSizeChanged()));
|
|
||||||
QObject::connect(dialog, SIGNAL(dialogVisible(bool)), q, SLOT(dialogStatusChanged(bool)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Dialog *dialog = new Dialog();
|
||||||
|
dialog->d->appletPtr = q;
|
||||||
|
dialogPtr = dialog;
|
||||||
|
|
||||||
|
if (icon) {
|
||||||
|
dialog->setAspectRatioMode(savedAspectRatio);
|
||||||
|
}
|
||||||
|
|
||||||
|
//no longer use Qt::Popup since that seems to cause a lot of problem when you drag
|
||||||
|
//stuff out of your Dialog (extenders). Monitor WindowDeactivate events so we can
|
||||||
|
//emulate the same kind of behavior as Qt::Popup (close when you click somewhere
|
||||||
|
//else.
|
||||||
|
|
||||||
|
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);
|
||||||
|
dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (gWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
|
||||||
|
} else if (qWidget) {
|
||||||
|
QVBoxLayout *l_layout = new QVBoxLayout(dialog);
|
||||||
|
l_layout->setSpacing(0);
|
||||||
|
l_layout->setMargin(0);
|
||||||
|
l_layout->addWidget(qWidget);
|
||||||
|
dialog->adjustSize();
|
||||||
|
dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (qWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
|
||||||
|
} else {
|
||||||
|
dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
|
||||||
|
}
|
||||||
|
|
||||||
|
restoreDialogSize();
|
||||||
|
KWindowSystem::setState(dialog->winId(), NET::SkipTaskbar | NET::SkipPager);
|
||||||
|
dialog->installEventFilter(q);
|
||||||
|
|
||||||
|
QObject::connect(dialog, SIGNAL(dialogResized()), q, SLOT(dialogSizeChanged()));
|
||||||
|
QObject::connect(dialog, SIGNAL(dialogVisible(bool)), q, SLOT(dialogStatusChanged(bool)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -591,7 +592,6 @@ PopupAppletPrivate::PopupAppletPrivate(PopupApplet *applet)
|
|||||||
: q(applet),
|
: q(applet),
|
||||||
icon(0),
|
icon(0),
|
||||||
widget(0),
|
widget(0),
|
||||||
graphicsWidget(0),
|
|
||||||
popupPlacement(Plasma::FloatingPopup),
|
popupPlacement(Plasma::FloatingPopup),
|
||||||
popupAlignment(Qt::AlignLeft),
|
popupAlignment(Qt::AlignLeft),
|
||||||
savedAspectRatio(Plasma::InvalidAspectRatioMode),
|
savedAspectRatio(Plasma::InvalidAspectRatioMode),
|
||||||
|
@ -58,7 +58,7 @@ public:
|
|||||||
QWeakPointer<Plasma::Dialog> dialogPtr;
|
QWeakPointer<Plasma::Dialog> dialogPtr;
|
||||||
QWeakPointer<QGraphicsProxyWidget> proxy;
|
QWeakPointer<QGraphicsProxyWidget> proxy;
|
||||||
QWidget *widget;
|
QWidget *widget;
|
||||||
QGraphicsWidget *graphicsWidget;
|
QWeakPointer<QGraphicsWidget> graphicsWidget;
|
||||||
Plasma::PopupPlacement popupPlacement;
|
Plasma::PopupPlacement popupPlacement;
|
||||||
Qt::AlignmentFlag popupAlignment;
|
Qt::AlignmentFlag popupAlignment;
|
||||||
Plasma::AspectRatioMode savedAspectRatio;
|
Plasma::AspectRatioMode savedAspectRatio;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user