BUG: 236853

BUG: 233235

Properly restore the size of PopupApplets from last session even when a preferredSize is set in the graphicsWidget()
This commit is contained in:
ruberg 2011-02-24 18:26:40 +01:00
parent 0abb1cfd6e
commit b23b9664be

View File

@ -400,7 +400,7 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
} }
dialog->setGraphicsWidget(gWidget); dialog->setGraphicsWidget(gWidget);
gWidget->resize(gWidget->preferredSize()); //gWidget->resize(gWidget->preferredSize());
dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (gWidget->windowFlags() & Qt::X11BypassWindowManagerHint)); dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint | (gWidget->windowFlags() & Qt::X11BypassWindowManagerHint));
} else if (qWidget) { } else if (qWidget) {
QVBoxLayout *l_layout = new QVBoxLayout(dialog); QVBoxLayout *l_layout = new QVBoxLayout(dialog);
@ -841,9 +841,10 @@ void PopupAppletPrivate::restoreDialogSize()
int preferredWidth = 0; int preferredWidth = 0;
int preferredHeight = 0; int preferredHeight = 0;
if (dialog->graphicsWidget()) { QGraphicsWidget *gWidget = dialog->graphicsWidget();
preferredWidth = dialog->graphicsWidget()->preferredSize().width(); if (gWidget) {
preferredHeight = dialog->graphicsWidget()->preferredSize().height(); preferredWidth = gWidget->preferredSize().width();
preferredHeight = gWidget->preferredSize().height();
} }
const int width = qMin(sizeGroup.readEntry("DialogWidth", preferredWidth), const int width = qMin(sizeGroup.readEntry("DialogWidth", preferredWidth),
@ -861,6 +862,9 @@ void PopupAppletPrivate::restoreDialogSize()
if (saved.width() != dialog->width() || saved.height() != dialog->height()) { if (saved.width() != dialog->width() || saved.height() != dialog->height()) {
dialog->resize(saved); dialog->resize(saved);
/*if (gWidget) {
gWidget->resize(saved);
}*/
} }
} }