Skip to content
Permalink
Browse files

Fix some more tiny icons on hidpi displays

  • Loading branch information
nyalldawson committed Jan 16, 2019
1 parent 0a119b9 commit 956a74fcb7f2e4b621aa0d0342bafa85b17ff8ca
Showing with 3 additions and 17 deletions.
  1. +2 −13 src/gui/symbology/qgsdashspacedialog.cpp
  2. +1 −4 src/gui/symbology/qgsrendererpropertiesdialog.cpp
@@ -17,25 +17,14 @@
#include "qgsapplication.h"
#include <QFile>

QString iconPath( const QString &iconFile )
{
// try active theme
QString path = QgsApplication::activeThemePath();
if ( QFile::exists( path + iconFile ) )
return path + iconFile;

// use default theme
return QgsApplication::defaultThemePath() + iconFile;
}

QgsDashSpaceDialog::QgsDashSpaceDialog( const QVector<qreal> &v, QWidget *parent, Qt::WindowFlags f ): QDialog( parent, f )
{
setupUi( this );
connect( mAddButton, &QPushButton::clicked, this, &QgsDashSpaceDialog::mAddButton_clicked );
connect( mRemoveButton, &QPushButton::clicked, this, &QgsDashSpaceDialog::mRemoveButton_clicked );

mAddButton->setIcon( QIcon( iconPath( "symbologyAdd.svg" ) ) );
mRemoveButton->setIcon( QIcon( iconPath( "symbologyRemove.svg" ) ) );
mAddButton->setIcon( QgsApplication::getThemeIcon( "symbologyAdd.svg" ) );
mRemoveButton->setIcon( QgsApplication::getThemeIcon( "symbologyRemove.svg" ) );

double dash = 0;
double space = 0;
@@ -53,10 +53,7 @@ static bool _initRenderer( const QString &name, QgsRendererWidgetFunc f, const Q

if ( !iconName.isEmpty() )
{
QString iconPath = QgsApplication::defaultThemePath() + iconName;
QPixmap pix;
if ( pix.load( iconPath ) )
m->setIcon( pix );
m->setIcon( QgsApplication::getThemeIcon( iconName ) );
}

QgsDebugMsg( "Set for " + name );

0 comments on commit 956a74f

Please sign in to comment.
You can’t perform that action at this time.