Skip to content

Commit

Permalink
Merge pull request #30363 from m-kuhn/no_hide_toolbars_qgis_welcome_page
Browse files Browse the repository at this point in the history
Revert "Hide panels and toolbars on welcome page"
  • Loading branch information
m-kuhn committed Jun 25, 2019
2 parents eb28199 + 674e5d7 commit c064368
Showing 1 changed file with 6 additions and 30 deletions.
36 changes: 6 additions & 30 deletions src/app/qgisapp.cpp
Expand Up @@ -843,6 +843,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh

connect( mMapCanvas, &QgsMapCanvas::layersChanged, this, &QgisApp::showMapCanvas );

mCentralContainer->setCurrentIndex( mProjOpen ? 0 : 1 );

// a bar to warn the user with non-blocking messages
startProfile( QStringLiteral( "Message bar" ) );
mInfoBar = new QgsMessageBar( centralWidget );
Expand Down Expand Up @@ -1491,32 +1493,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
{
mCentralContainer->setCurrentIndex( 0 );
} );

// As the last thing set the welcome page and restore dock and panel visibility

connect( mCentralContainer, &QStackedWidget::currentChanged, this, [ this ]( int index )
{
QgsSettings settings;

if ( index == 1 ) // welcomepage
{
if ( settings.value( QStringLiteral( "UI/allWidgetsVisible" ), true ).toBool() )
{
toggleReducedView( false );
settings.setValue( QStringLiteral( "UI/widgetsHiddenForWelcomePage" ), true );
}
}
else
{
if ( settings.value( QStringLiteral( "UI/widgetsHiddenForWelcomePage" ), false ).toBool() && !QgsSettings().value( QStringLiteral( "UI/allWidgetsVisible" ), true ).toBool() )
{
toggleReducedView( true );
}
settings.setValue( QStringLiteral( "UI/widgetsHiddenForWelcomePage" ), false );
}
} );

mCentralContainer->setCurrentIndex( 1 );
} // QgisApp ctor

QgisApp::QgisApp()
Expand Down Expand Up @@ -6825,8 +6801,8 @@ void QgisApp::toggleReducedView( bool viewMapOnly )
}
}

menuBar()->setVisible( false );
statusBar()->setVisible( false );
this->menuBar()->setVisible( false );
this->statusBar()->setVisible( false );

settings.setValue( QStringLiteral( "UI/hiddenToolBarsActive" ), toolBarsActive );
}
Expand Down Expand Up @@ -6881,8 +6857,8 @@ void QgisApp::toggleReducedView( bool viewMapOnly )
toolBar->setVisible( true );
}
}
menuBar()->setVisible( true );
statusBar()->setVisible( true );
this->menuBar()->setVisible( true );
this->statusBar()->setVisible( true );

settings.remove( QStringLiteral( "UI/hiddenToolBarsActive" ) );
settings.remove( QStringLiteral( "UI/hiddenDocksTitle" ) );
Expand Down

0 comments on commit c064368

Please sign in to comment.