Skip to content

Commit ee6948d

Browse files
committed
[gui] keep dock icons one size smaller than toolbar icons
1 parent 7db5272 commit ee6948d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/app/qgisappstylesheet.cpp

+14-2
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,21 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
176176
.arg( palette.highlight().color().name() )
177177
.arg( palette.highlightedText().color().name() );
178178

179-
QString iconSize = opts.value( "iconSize" ).toString();
179+
int iconSize = opts.value( "iconSize" ).toInt();
180+
if ( iconSize > 32 )
181+
{
182+
iconSize -= 16;
183+
}
184+
else if ( iconSize == 32 )
185+
{
186+
iconSize = 24;
187+
}
188+
else
189+
{
190+
iconSize = 16;
191+
}
192+
180193
QgsDebugMsg( QString( "iconSize: %1" ).arg( iconSize ) );
181-
if ( iconSize.isEmpty() ) { return; }
182194
ss += QString( "QDockWidget QToolButton { icon-size: %1px; }" ).arg( iconSize );
183195

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

0 commit comments

Comments
 (0)