* always create a layout if possible
* trying to set the minimum size here is not helpful; this should be handle by layouts svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=874992
This commit is contained in:
parent
d9e5d8babd
commit
116a1d690c
@ -125,7 +125,7 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
||||
(f == Plasma::Vertical || f == Plasma::Horizontal))) {
|
||||
QGraphicsLinearLayout *lay = dynamic_cast<QGraphicsLinearLayout *>(q->layout());
|
||||
|
||||
if (icon && lay) {
|
||||
if (icon && !icon->icon().isNull() && lay) {
|
||||
lay->removeAt(0);
|
||||
}
|
||||
|
||||
@ -176,12 +176,6 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
||||
dialog = 0;
|
||||
}
|
||||
|
||||
//get the margins
|
||||
QSizeF marginSize = q->size() - q->contentsRect().size();
|
||||
|
||||
if (gWidget) {
|
||||
q->setMinimumSize(gWidget->minimumSize() + marginSize);
|
||||
//kDebug() << lay << q->layout();
|
||||
if (!lay && !q->layout()) {
|
||||
lay = new QGraphicsLinearLayout();
|
||||
lay->setContentsMargins(0, 0, 0, 0);
|
||||
@ -190,14 +184,13 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
||||
q->setLayout(lay);
|
||||
}
|
||||
|
||||
if (gWidget) {
|
||||
Extender *extender = qobject_cast<Extender*>(gWidget);
|
||||
if (extender) {
|
||||
extender->setExtenderAppearance(Extender::NoBorders);
|
||||
}
|
||||
|
||||
q->setMinimumSize(gWidget->minimumSize() + marginSize);
|
||||
lay->addItem(gWidget);
|
||||
//gWidget->installEventFilter(q);
|
||||
} else if (qWidget) {
|
||||
if (!proxy) {
|
||||
proxy = new QGraphicsProxyWidget(q);
|
||||
@ -208,8 +201,6 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
||||
if (lay) {
|
||||
lay->addItem(proxy);
|
||||
}
|
||||
|
||||
q->setMinimumSize(qWidget->minimumSize() + marginSize);
|
||||
}
|
||||
} else {
|
||||
//save the aspect ratio mode in case we drag'n drop in the Desktop later
|
||||
|
Loading…
Reference in New Issue
Block a user