Skip to content

Commit 956a74f

Browse files
committedJan 16, 2019
Fix some more tiny icons on hidpi displays
1 parent 0a119b9 commit 956a74f

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed
 

‎src/gui/symbology/qgsdashspacedialog.cpp

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,14 @@
1717
#include "qgsapplication.h"
1818
#include <QFile>
1919

20-
QString iconPath( const QString &iconFile )
21-
{
22-
// try active theme
23-
QString path = QgsApplication::activeThemePath();
24-
if ( QFile::exists( path + iconFile ) )
25-
return path + iconFile;
26-
27-
// use default theme
28-
return QgsApplication::defaultThemePath() + iconFile;
29-
}
30-
3120
QgsDashSpaceDialog::QgsDashSpaceDialog( const QVector<qreal> &v, QWidget *parent, Qt::WindowFlags f ): QDialog( parent, f )
3221
{
3322
setupUi( this );
3423
connect( mAddButton, &QPushButton::clicked, this, &QgsDashSpaceDialog::mAddButton_clicked );
3524
connect( mRemoveButton, &QPushButton::clicked, this, &QgsDashSpaceDialog::mRemoveButton_clicked );
3625

37-
mAddButton->setIcon( QIcon( iconPath( "symbologyAdd.svg" ) ) );
38-
mRemoveButton->setIcon( QIcon( iconPath( "symbologyRemove.svg" ) ) );
26+
mAddButton->setIcon( QgsApplication::getThemeIcon( "symbologyAdd.svg" ) );
27+
mRemoveButton->setIcon( QgsApplication::getThemeIcon( "symbologyRemove.svg" ) );
3928

4029
double dash = 0;
4130
double space = 0;

‎src/gui/symbology/qgsrendererpropertiesdialog.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ static bool _initRenderer( const QString &name, QgsRendererWidgetFunc f, const Q
5353

5454
if ( !iconName.isEmpty() )
5555
{
56-
QString iconPath = QgsApplication::defaultThemePath() + iconName;
57-
QPixmap pix;
58-
if ( pix.load( iconPath ) )
59-
m->setIcon( pix );
56+
m->setIcon( QgsApplication::getThemeIcon( iconName ) );
6057
}
6158

6259
QgsDebugMsg( "Set for " + name );

0 commit comments

Comments
 (0)
Please sign in to comment.