[gui] keep dock icons one size smaller than toolbar icons

This commit is contained in:
nirvn 2015-05-29 09:48:12 +07:00
parent 7db5272f31
commit ee6948d3d4

View File

@ -176,9 +176,21 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
.arg( palette.highlight().color().name() )
.arg( palette.highlightedText().color().name() );
QString iconSize = opts.value( "iconSize" ).toString();
int iconSize = opts.value( "iconSize" ).toInt();
if ( iconSize > 32 )
{
iconSize -= 16;
}
else if ( iconSize == 32 )
{
iconSize = 24;
}
else
{
iconSize = 16;
}
QgsDebugMsg( QString( "iconSize: %1" ).arg( iconSize ) );
if ( iconSize.isEmpty() ) { return; }
ss += QString( "QDockWidget QToolButton { icon-size: %1px; }" ).arg( iconSize );
QgsDebugMsg( QString( "Stylesheet built: %1" ).arg( ss ) );