Skip to content
Permalink
Browse files

Only apply custom toolbar spacing for default theme

  • Loading branch information
nirvn committed Jan 1, 2019
1 parent aa7d4a7 commit 540f9520b7f89d4aef00a6e3d67d498d5ee72c3a
Showing with 12 additions and 11 deletions.
  1. +12 −11 src/app/qgisappstylesheet.cpp
@@ -143,6 +143,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;
}

@@ -156,17 +168,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 );

0 comments on commit 540f952

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