Skip to content
Permalink
Browse files
Merge pull request #2091 from nirvn/fix_tool_button_size
[GUI] Keep dock icons one size smaller than toolbar icons
  • Loading branch information
NathanW2 committed May 29, 2015
2 parents 7db5272 + 62c837e commit 04388f73c60b83cccfe82fc04890c765421adf2b
Showing with 16 additions and 4 deletions.
  1. +14 −2 src/app/qgisappstylesheet.cpp
  2. +2 −2 src/ui/qgsbrowserdockwidgetbase.ui
@@ -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 ) );
@@ -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">

0 comments on commit 04388f7

Please sign in to comment.