Skip to content

Commit 015508c

Browse files
committed
Only apply custom toolbar spacing for default theme
1 parent 1b460b5 commit 015508c

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/app/qgisappstylesheet.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
141141
" background-color:palette(Window);"
142142
" padding-right: 0px;"
143143
"}";
144+
145+
QString toolbarSpacing = opts.value( QStringLiteral( "toolbarSpacing" ), QString() ).toString();
146+
if ( !toolbarSpacing.isEmpty() )
147+
{
148+
bool ok = false;
149+
int toolbarSpacingInt = toolbarSpacing.toInt( &ok );
150+
if ( ok )
151+
{
152+
style += QStringLiteral( "QToolBar > QToolButton { padding: %1px; } " ).arg( toolbarSpacingInt );
153+
}
154+
}
155+
144156
ss += style;
145157
}
146158

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

157-
QString toolbarSpacing = opts.value( QStringLiteral( "toolbarSpacing" ), QString() ).toString();
158-
if ( !toolbarSpacing.isEmpty() )
159-
{
160-
bool ok = false;
161-
int toolbarSpacingInt = toolbarSpacing.toInt( &ok );
162-
if ( ok )
163-
{
164-
ss += QStringLiteral( "QToolBar > QToolButton { padding: %1px; } " ).arg( toolbarSpacingInt );
165-
}
166-
}
167-
168169
QgsDebugMsg( QStringLiteral( "Stylesheet built: %1" ).arg( ss ) );
169170

170171
emit appStyleSheetChanged( ss );

0 commit comments

Comments
 (0)