Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hidpi icon size fixes
  • Loading branch information
nyalldawson committed Feb 3, 2019
1 parent 1c92fd2 commit 15bcbf8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgsscalerangewidget.cpp
Expand Up @@ -17,6 +17,7 @@
#include "qgsapplication.h"
#include "qgsproject.h"
#include "qgsscalewidget.h"
#include "qgsguiutils.h"

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

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

mMinimumScaleWidget = new QgsScaleWidget( this );
mMaximumScaleWidget = new QgsScaleWidget( this );
Expand Down
3 changes: 3 additions & 0 deletions src/gui/qgstextformatwidget.cpp
Expand Up @@ -83,6 +83,7 @@ void QgsTextFormatWidget::initWidget()
const int iconSize = QgsGuiUtils::scaleIconSize( 20 );
mOptionsTab->setIconSize( QSize( iconSize, iconSize ) );
const int iconSize32 = QgsGuiUtils::scaleIconSize( 32 );
const int iconSize24 = QgsGuiUtils::scaleIconSize( 24 );
const int iconSize18 = QgsGuiUtils::scaleIconSize( 18 );
mPointOffsetAboveLeft->setIconSize( QSize( iconSize32, iconSize18 ) );
mPointOffsetAbove->setIconSize( QSize( iconSize32, iconSize18 ) );
Expand All @@ -93,6 +94,8 @@ void QgsTextFormatWidget::initWidget()
mPointOffsetBelowLeft->setIconSize( QSize( iconSize32, iconSize18 ) );
mPointOffsetBelow->setIconSize( QSize( iconSize32, iconSize18 ) );
mPointOffsetBelowRight->setIconSize( QSize( iconSize32, iconSize18 ) );
mLabelMinScale->setPixmap( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomOut.svg" ) ).pixmap( QSize( iconSize24, iconSize24 ) ) );
mLabelMaxScale->setPixmap( QgsApplication::getThemeIcon( QStringLiteral( "/mActionZoomIn.svg" ) ).pixmap( QSize( iconSize24, iconSize24 ) ) );

const int buttonSize = QgsGuiUtils::scaleIconSize( 24 );
mFontUnderlineBtn->setMinimumSize( buttonSize, buttonSize );
Expand Down
4 changes: 2 additions & 2 deletions src/ui/qgstextformatwidgetbase.ui
Expand Up @@ -5482,7 +5482,7 @@ font-style: italic;</string>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="mLabelMinScale">
<property name="toolTip">
<string>Minimum scale, i.e. most &quot;zoomed out&quot;.</string>
</property>
Expand All @@ -5495,7 +5495,7 @@ font-style: italic;</string>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_11">
<widget class="QLabel" name="mLabelMaxScale">
<property name="toolTip">
<string>Maximum scale, i.e. most &quot;zoomed in&quot;.</string>
</property>
Expand Down

0 comments on commit 15bcbf8

Please sign in to comment.