Skip to content

Commit 15bcbf8

Browse files
committedFeb 3, 2019
Hidpi icon size fixes
1 parent 1c92fd2 commit 15bcbf8

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed
 

‎src/gui/qgsscalerangewidget.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "qgsapplication.h"
1818
#include "qgsproject.h"
1919
#include "qgsscalewidget.h"
20+
#include "qgsguiutils.h"
2021

2122
QgsScaleRangeWidget::QgsScaleRangeWidget( QWidget *parent )
2223
: QWidget( parent )
@@ -36,10 +37,11 @@ QgsScaleRangeWidget::QgsScaleRangeWidget( QWidget *parent )
3637
maxLbl->setToolTip( tr( "Maximum scale, i.e. most \"zoomed in\". "
3738
"This limit is inclusive, that means the layer will be displayed on this scale." ) );
3839

40+
const int iconSize = QgsGuiUtils::scaleIconSize( 24 );
3941
mMinimumScaleIconLabel = new QLabel( this );
40-
mMinimumScaleIconLabel->setPixmap( QgsApplication::getThemePixmap( QStringLiteral( "/mActionZoomOut.svg" ) ) );
42+
mMinimumScaleIconLabel->setPixmap( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomOut.svg" ) ).pixmap( QSize( iconSize, iconSize ) ) );
4143
mMaximumScaleIconLabel = new QLabel( this );
42-
mMaximumScaleIconLabel->setPixmap( QgsApplication::getThemePixmap( QStringLiteral( "/mActionZoomIn.svg" ) ) );
44+
mMaximumScaleIconLabel->setPixmap( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ).pixmap( QSize( iconSize, iconSize ) ) );
4345

4446
mMinimumScaleWidget = new QgsScaleWidget( this );
4547
mMaximumScaleWidget = new QgsScaleWidget( this );

‎src/gui/qgstextformatwidget.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void QgsTextFormatWidget::initWidget()
8383
const int iconSize = QgsGuiUtils::scaleIconSize( 20 );
8484
mOptionsTab->setIconSize( QSize( iconSize, iconSize ) );
8585
const int iconSize32 = QgsGuiUtils::scaleIconSize( 32 );
86+
const int iconSize24 = QgsGuiUtils::scaleIconSize( 24 );
8687
const int iconSize18 = QgsGuiUtils::scaleIconSize( 18 );
8788
mPointOffsetAboveLeft->setIconSize( QSize( iconSize32, iconSize18 ) );
8889
mPointOffsetAbove->setIconSize( QSize( iconSize32, iconSize18 ) );
@@ -93,6 +94,8 @@ void QgsTextFormatWidget::initWidget()
9394
mPointOffsetBelowLeft->setIconSize( QSize( iconSize32, iconSize18 ) );
9495
mPointOffsetBelow->setIconSize( QSize( iconSize32, iconSize18 ) );
9596
mPointOffsetBelowRight->setIconSize( QSize( iconSize32, iconSize18 ) );
97+
mLabelMinScale->setPixmap( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomOut.svg" ) ).pixmap( QSize( iconSize24, iconSize24 ) ) );
98+
mLabelMaxScale->setPixmap( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ).pixmap( QSize( iconSize24, iconSize24 ) ) );
9699

97100
const int buttonSize = QgsGuiUtils::scaleIconSize( 24 );
98101
mFontUnderlineBtn->setMinimumSize( buttonSize, buttonSize );

‎src/ui/qgstextformatwidgetbase.ui

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5482,7 +5482,7 @@ font-style: italic;</string>
54825482
</widget>
54835483
</item>
54845484
<item row="0" column="0">
5485-
<widget class="QLabel" name="label">
5485+
<widget class="QLabel" name="mLabelMinScale">
54865486
<property name="toolTip">
54875487
<string>Minimum scale, i.e. most &quot;zoomed out&quot;.</string>
54885488
</property>
@@ -5495,7 +5495,7 @@ font-style: italic;</string>
54955495
</widget>
54965496
</item>
54975497
<item row="1" column="0">
5498-
<widget class="QLabel" name="label_11">
5498+
<widget class="QLabel" name="mLabelMaxScale">
54995499
<property name="toolTip">
55005500
<string>Maximum scale, i.e. most &quot;zoomed in&quot;.</string>
55015501
</property>

0 commit comments

Comments
 (0)
Please sign in to comment.