Merge pull request #2091 from nirvn/fix_tool_button_size

[GUI] Keep dock icons one size smaller than toolbar icons
This commit is contained in:
Nathan Woodrow 2015-05-29 13:30:08 +10:00
commit 04388f73c6
2 changed files with 16 additions and 4 deletions

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 ) );

View File

@ -33,10 +33,10 @@
<number>6</number>
</property>
<property name="leftMargin">
<number>0</number>
<number>5</number>
</property>
<property name="rightMargin">
<number>0</number>
<number>5</number>
</property>
<item>
<widget class="QToolButton" name="mBtnRefresh">