Skip to content
Permalink
Browse files

On first load, default to 80% of current screen size for main window

Using a fixed default window geometry wasn't working well anymore -
it made the default window size tiny on hidpi screens.
  • Loading branch information
nyalldawson committed Jul 18, 2017
1 parent 7ec8c4a commit dbd50b4bdd6fa13af1754de26f494d0bf8bdcab6
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/app/qgisapp.cpp
@@ -3787,9 +3787,13 @@ void QgisApp::restoreWindowState()
}

// restore window geometry
if ( !restoreGeometry( settings.value( QStringLiteral( "UI/geometry" ), QByteArray::fromRawData( reinterpret_cast< const char * >( defaultUIgeometry ), sizeof defaultUIgeometry ) ).toByteArray() ) )
if ( !restoreGeometry( settings.value( QStringLiteral( "UI/geometry" ) ).toByteArray() ) )
{
QgsDebugMsg( "restore of UI geometry failed" );
// default to 80% of screen size, at 10% from top left corner
resize( QDesktopWidget().availableGeometry( this ).size() * 0.8 );
QSize pos = QDesktopWidget().availableGeometry( this ).size() * 0.1;
move( pos.width(), pos.height() );
}

}

3 comments on commit dbd50b4

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn replied Jul 18, 2017

@nyalldawson , someone got himself a HiDPI monitor recently? 😉

@nyalldawson

This comment has been minimized.

Copy link
Collaborator Author

@nyalldawson nyalldawson replied Jul 18, 2017

Yeah - new laptop. I spent so long telling myself that I wouldn't get a hidpi screen so that someone else can deal with all these issues.... ah well.

I'm just trying to make the defaults a bit more usable. I won't take it much further than this though - my laptop is just for coding (not mapping). Plus, it's a good simple task for others to contribute related fixes.

@nirvn

This comment has been minimized.

Copy link
Contributor

@nirvn nirvn replied Jul 18, 2017

@nyalldawson , agreed.

Please sign in to comment.
You can’t perform that action at this time.