sanitize sizing of widgets displayed in popupapplet

svn path=/trunk/KDE/kdelibs/; revision=887767
This commit is contained in:
Marco Martin 2008-11-22 20:22:22 +00:00
parent a46f365dcd
commit ff6030e4f4
2 changed files with 11 additions and 4 deletions

View File

@ -146,8 +146,8 @@ void DialogPrivate::adjustView()
qMin(int(widget->minimumSize().height()) + top + bottom, QWIDGETSIZE_MAX));
q->setMaximumSize(qMin(int(widget->maximumSize().width()) + left + right, QWIDGETSIZE_MAX),
qMin(int(widget->maximumSize().height()) + top + bottom, QWIDGETSIZE_MAX));
q->resize(qMin(int(view->size().width()) + left + right, QWIDGETSIZE_MAX),
qMin(int(view->size().height()) + top + bottom, QWIDGETSIZE_MAX));
q->resize(qMin(int(widget->size().width()) + left + right, QWIDGETSIZE_MAX),
qMin(int(widget->size().height()) + top + bottom, QWIDGETSIZE_MAX));
q->updateGeometry();
//reposition and resize the view.

View File

@ -258,8 +258,15 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
//could that cast ever fail??
if (corona) {
corona->addOffscreenWidget(gWidget);
gWidget->resize(gWidget->preferredSize());
gWidget->setMinimumSize(gWidget->preferredSize());
//necessary to mess around with the offscreen widget
QGraphicsLayoutItem *layout = gWidget->parentLayoutItem();
QGraphicsWidget *parentWidget = gWidget->parentWidget();
if (layout && parentWidget) {
layout->updateGeometry();
parentWidget->resize(layout->preferredSize());
}
dialog->setGraphicsWidget(gWidget);
}
} else if (qWidget) {