From d64cf64fcce44285fb32011c62eff531e79d35a5 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 25 Aug 2014 20:30:38 +0200 Subject: [PATCH] save/restore whole geometry --- plasma-windowed/plasmawindowedview.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plasma-windowed/plasmawindowedview.cpp b/plasma-windowed/plasmawindowedview.cpp index 702cd759a..d78cc2c76 100644 --- a/plasma-windowed/plasmawindowedview.cpp +++ b/plasma-windowed/plasmawindowedview.cpp @@ -59,10 +59,9 @@ void PlasmaWindowedView::setApplet(Plasma::Applet *applet) return; } - int width = m_applet->config().readEntry("width", 0); - int height = m_applet->config().readEntry("height", 0); - if (width > 0 && height > 0) { - resize(QSize(width, height)); + const QRect geom = m_applet->config().readEntry("geometry", QRect()); + if (geom.isValid()) { + setGeometry(geom); } i->setParentItem(contentItem()); @@ -89,6 +88,8 @@ void PlasmaWindowedView::resizeEvent(QResizeEvent *ev) contentItem()->setHeight(ev->size().height()); m_applet->config().writeEntry("width", ev->size().width()); m_applet->config().writeEntry("height", ev->size().height()); + + m_applet->config().writeEntry("geometry", QRect(position(), ev->size())); } #include "plasmawindowedview.moc"