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

ensured the window geometry is remembered on OS X

* ensured the window geometry is remembered on OS X

It was always starting based on:
int windowWidth = desktop->availableGeometry().width() / 1.3;
int windowHeight = desktop->availableGeometry().height() / 1.3;

because quitApp isn’t called on OS X.

* ensured the window geometry is remembered on OS X (v2)

* tweaked coding style
This commit is contained in:
ravas 2016-04-05 00:07:40 -07:00 committed by David Rosca
parent 209ba1f44c
commit effda91f7c
2 changed files with 8 additions and 19 deletions

View File

@ -1345,17 +1345,11 @@ void BrowserWindow::closeEvent(QCloseEvent* event)
}
}
#ifndef Q_OS_MAC
if (mApp->windowCount() == 1) {
if (quitApp()) {
event->accept();
}
else {
event->ignore();
}
saveSettings();
return;
}
#ifndef Q_OS_MAC
if (mApp->windowCount() == 1)
mApp->quitApplication();
#endif
event->accept();
@ -1385,7 +1379,7 @@ void BrowserWindow::closeWindow()
}
}
bool BrowserWindow::quitApp()
void BrowserWindow::saveSettings()
{
if (m_sideBar) {
saveSideBarWidth();
@ -1399,15 +1393,10 @@ bool BrowserWindow::quitApp()
settings.setValue("WebSearchBarWidth", m_navigationToolbar->splitter()->sizes().at(1));
settings.setValue("SideBarWidth", m_sideBarWidth);
settings.setValue("WebViewWidth", m_webViewWidth);
if (!isFullScreen()) {
if (!isFullScreen())
settings.setValue("WindowGeometry", saveGeometry());
}
settings.endGroup();
}
mApp->quitApplication();
return true;
}
void BrowserWindow::closeTab()

View File

@ -156,7 +156,7 @@ private slots:
void searchOnPage();
void changeEncoding();
bool quitApp();
void saveSettings();
void hideNavigationSlot();
private: