Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix some more tiny icons on hidpi displays
(cherry picked from commit 956a74f)
  • Loading branch information
nyalldawson committed Jan 17, 2019
1 parent 6f2daac commit 4d54a1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
15 changes: 2 additions & 13 deletions src/gui/symbology/qgsdashspacedialog.cpp
Expand Up @@ -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;
Expand Down
5 changes: 1 addition & 4 deletions src/gui/symbology/qgsrendererpropertiesdialog.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 4d54a1f

Please sign in to comment.