Skip to content

Commit

Permalink
[themes] Handle non-existent theme name setting in app stylesheet
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 20, 2019
1 parent 2a148e2 commit 82e189e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/app/qgisappstylesheet.cpp
Expand Up @@ -124,7 +124,7 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
ss += QLatin1String( "QGroupBox{ font-weight: 600; }" ); ss += QLatin1String( "QGroupBox{ font-weight: 600; }" );


QString themeName = settings.value( QStringLiteral( "UI/UITheme" ), "default" ).toString(); QString themeName = settings.value( QStringLiteral( "UI/UITheme" ), "default" ).toString();
if ( themeName == QStringLiteral( "default" ) ) if ( themeName == QStringLiteral( "default" ) || !QgsApplication::uiThemes().contains( themeName ) )
{ {
//sidebar style //sidebar style
QString style = "QListWidget#mOptionsListWidget {" QString style = "QListWidget#mOptionsListWidget {"
Expand Down
4 changes: 4 additions & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -567,6 +567,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
whileBlocking( cmbStyle )->setCurrentIndex( cmbStyle->findText( name, Qt::MatchFixedString ) ); whileBlocking( cmbStyle )->setCurrentIndex( cmbStyle->findText( name, Qt::MatchFixedString ) );


QString theme = mSettings->value( QStringLiteral( "UI/UITheme" ), QStringLiteral( "default" ) ).toString(); QString theme = mSettings->value( QStringLiteral( "UI/UITheme" ), QStringLiteral( "default" ) ).toString();
if ( !QgsApplication::uiThemes().contains( theme ) )
{
theme = QStringLiteral( "default" );
}
whileBlocking( cmbUITheme )->setCurrentIndex( cmbUITheme->findText( theme, Qt::MatchFixedString ) ); whileBlocking( cmbUITheme )->setCurrentIndex( cmbUITheme->findText( theme, Qt::MatchFixedString ) );


mNativeColorDialogsChkBx->setChecked( mSettings->value( QStringLiteral( "/qgis/native_color_dialogs" ), false ).toBool() ); mNativeColorDialogsChkBx->setChecked( mSettings->value( QStringLiteral( "/qgis/native_color_dialogs" ), false ).toBool() );
Expand Down

0 comments on commit 82e189e

Please sign in to comment.