Skip to content

Commit

Permalink
Only apply custom toolbar spacing for default theme
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jan 1, 2019
1 parent 1b460b5 commit 015508c
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/app/qgisappstylesheet.cpp
Expand Up @@ -141,6 +141,18 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
" background-color:palette(Window);"
" padding-right: 0px;"
"}";

QString toolbarSpacing = opts.value( QStringLiteral( "toolbarSpacing" ), QString() ).toString();
if ( !toolbarSpacing.isEmpty() )
{
bool ok = false;
int toolbarSpacingInt = toolbarSpacing.toInt( &ok );
if ( ok )
{
style += QStringLiteral( "QToolBar > QToolButton { padding: %1px; } " ).arg( toolbarSpacingInt );
}
}

ss += style;
}

Expand All @@ -154,17 +166,6 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
.arg( palette.highlight().color().name(),
palette.highlightedText().color().name() );

QString toolbarSpacing = opts.value( QStringLiteral( "toolbarSpacing" ), QString() ).toString();
if ( !toolbarSpacing.isEmpty() )
{
bool ok = false;
int toolbarSpacingInt = toolbarSpacing.toInt( &ok );
if ( ok )
{
ss += QStringLiteral( "QToolBar > QToolButton { padding: %1px; } " ).arg( toolbarSpacingInt );
}
}

QgsDebugMsg( QStringLiteral( "Stylesheet built: %1" ).arg( ss ) );

emit appStyleSheetChanged( ss );
Expand Down

0 comments on commit 015508c

Please sign in to comment.