Merge pull request #404 from xiaoyifang/fix/restore-max

fix: windows can not restore the Geometry
This commit is contained in:
xiaoyifang 2023-03-20 23:36:30 +08:00 committed by GitHub
commit 669be41d9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -706,14 +706,7 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
connect( &ftsIndexing, &FTS::FtsIndexing::newIndexingName, this, &MainWindow::showFTSIndexingName );
#ifndef Q_OS_MAC
{
if ( cfg.mainWindowGeometry.size() )
restoreGeometry( cfg.mainWindowGeometry );
if ( cfg.mainWindowState.size() )
restoreState( cfg.mainWindowState, 1 );
}
#endif
applyProxySettings();
@ -736,21 +729,28 @@ MainWindow::MainWindow( Config::Class & cfg_ ):
setWindowTitle( "GoldenDict" );
#ifdef Q_OS_MAC
{
if ( cfg.mainWindowGeometry.size() )
restoreGeometry( cfg.mainWindowGeometry );
if ( cfg.mainWindowState.size() )
restoreState( cfg.mainWindowState, 1 );
}
#endif
blockUpdateWindowTitle = true;
addNewTab();
// Create tab list menu
createTabList();
#ifndef Q_OS_MAC
{
if( cfg.mainWindowGeometry.size() )
restoreGeometry( cfg.mainWindowGeometry );
if( cfg.mainWindowState.size() )
restoreState( cfg.mainWindowState, 1 );
}
#else
{
if( cfg.mainWindowGeometry.size() )
restoreGeometry( cfg.mainWindowGeometry );
if( cfg.mainWindowState.size() )
restoreState( cfg.mainWindowState, 1 );
}
#endif
// Show the initial welcome text
{