sanitize sizing of widgets displayed in popupapplet
svn path=/trunk/KDE/kdelibs/; revision=887767
This commit is contained in:
parent
a46f365dcd
commit
ff6030e4f4
@ -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.
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user