mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-21 16:27:39 -06:00
Use a more reasonable dynamic default for the window size (90% x 90%). Fixes #1939
This commit is contained in:
parent
6e5683064e
commit
297733634b
@ -125,9 +125,20 @@ BrowserWindow::BrowserWindow(QString url)
|
||||
m_mainWebView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
|
||||
#endif
|
||||
|
||||
// Restore the geometry
|
||||
// Restore the geometry, or set a nice default
|
||||
QSettings settings;
|
||||
restoreGeometry(settings.value("Browser/Geometry").toByteArray());
|
||||
|
||||
QSize availableSize = qApp->desktop()->availableGeometry().size();
|
||||
QSize defaultSize(availableSize.width() * 0.9, availableSize.height() * 0.9);
|
||||
|
||||
QRect defaultGeometry = QStyle::alignedRect(
|
||||
Qt::LeftToRight,
|
||||
Qt::AlignCenter,
|
||||
defaultSize,
|
||||
qApp->desktop()->availableGeometry()
|
||||
);
|
||||
|
||||
restoreGeometry(settings.value("Browser/Geometry", defaultGeometry).toByteArray());
|
||||
restoreState(settings.value("Browser/WindowState").toByteArray());
|
||||
|
||||
// Set the initial zoom
|
||||
|
Loading…
Reference in New Issue
Block a user