Skip to content

Commit

Permalink
Merge pull request #2091 from nirvn/fix_tool_button_size
Browse files Browse the repository at this point in the history
[GUI] Keep dock icons one size smaller than toolbar icons
  • Loading branch information
NathanW2 committed May 29, 2015
2 parents 7db5272 + 62c837e commit 04388f7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions src/app/qgisappstylesheet.cpp
Expand Up @@ -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 ) );
Expand Down
4 changes: 2 additions & 2 deletions src/ui/qgsbrowserdockwidgetbase.ui
Expand Up @@ -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">
Expand Down

0 comments on commit 04388f7

Please sign in to comment.