Skip to content
Permalink
Browse files
[gui] apply icon size user preference to dock widget tool buttons (fix
  • Loading branch information
nirvn committed May 24, 2015
1 parent 2ff6f72 commit a0a1cea0e17b09264c60ba0d1d29560013ca060f
Showing with 11 additions and 0 deletions.
  1. +8 −0 src/app/qgisappstylesheet.cpp
  2. +3 −0 src/app/qgsoptions.cpp
@@ -18,6 +18,7 @@

#include "qgisappstylesheet.h"
#include "qgsapplication.h"
#include "qgisapp.h"
#include "qgslogger.h"

#include <QFont>
@@ -91,6 +92,8 @@ QMap<QString, QVariant> QgisAppStyleSheet::defaultOptions()

settings.endGroup(); // "qgis/stylesheet"

opts.insert( "iconSize", settings.value( "/IconSize", QGIS_ICON_SIZE ) );

return opts;
}

@@ -173,6 +176,11 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
.arg( palette.highlight().color().name() )
.arg( palette.highlightedText().color().name() );

QString iconSize = opts.value( "iconSize" ).toString();
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 ) );

emit appStyleSheetChanged( ss );
@@ -925,6 +925,9 @@ void QgsOptions::on_pbnTemplateFolderReset_pressed()
void QgsOptions::iconSizeChanged( const QString &iconSize )
{
QgisApp::instance()->setIconSizes( iconSize.toInt() );

mStyleSheetNewOpts.insert( "iconSize", QVariant( iconSize.toInt() ) );
mStyleSheetBuilder->buildStyleSheet( mStyleSheetNewOpts );
}

void QgsOptions::on_mProjectOnLaunchCmbBx_currentIndexChanged( int indx )

0 comments on commit a0a1cea

Please sign in to comment.