1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Using saveGeometry and restoreGeometry for saving window geometry.

- instead of only geometry()
This commit is contained in:
nowrep 2012-02-01 20:31:51 +01:00
parent 64cea6cfee
commit 137275c8a5

View File

@ -200,7 +200,10 @@ void QupZilla::setupUi()
setWindowState(Qt::WindowMaximized); setWindowState(Qt::WindowMaximized);
} }
else { else {
setGeometry(settings.value("WindowGeometry", QRect(20, 20, 800, 550)).toRect()); if (!restoreGeometry(settings.value("WindowGeometry").toByteArray())) {
setGeometry(QRect(20, 20, 800, 550));
}
if (m_startBehaviour == Qz::BW_NewWindow) { if (m_startBehaviour == Qz::BW_NewWindow) {
// Moving window +40 x,y to be visible that this is new window // Moving window +40 x,y to be visible that this is new window
QPoint p = pos(); QPoint p = pos();
@ -1678,14 +1681,7 @@ bool QupZilla::quitApp()
settings.beginGroup("Browser-View-Settings"); settings.beginGroup("Browser-View-Settings");
settings.setValue("WindowMaximised", windowState().testFlag(Qt::WindowMaximized)); settings.setValue("WindowMaximised", windowState().testFlag(Qt::WindowMaximized));
#ifdef Q_OS_OS2 settings.setValue("WindowGeometry", saveGeometry());
// Workaround on OS/2 where geometry() is returning bad Y axis (+ 20 pixels)
QRect windowGeometry = geometry();
windowGeometry.setY(windowGeometry.y() - 20);
settings.setValue("WindowGeometry", windowGeometry);
#else
settings.setValue("WindowGeometry", geometry());
#endif
settings.setValue("LocationBarWidth", m_navigationBar->splitter()->sizes().at(0)); settings.setValue("LocationBarWidth", m_navigationBar->splitter()->sizes().at(0));
settings.setValue("WebSearchBarWidth", m_navigationBar->splitter()->sizes().at(1)); settings.setValue("WebSearchBarWidth", m_navigationBar->splitter()->sizes().at(1));
settings.setValue("SideBarWidth", m_sideBarWidth); settings.setValue("SideBarWidth", m_sideBarWidth);