Skip to content

Commit

Permalink
Fix some more tiny icons on hidpi displays
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 16, 2019
1 parent 0a119b9 commit 956a74f
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 956a74f

Please sign in to comment.