Skip to content

Commit 62a5bc4

Browse files
committedApr 17, 2019
[ui] Fix layout designer panel icon (re)sizing
1 parent d87c0a2 commit 62a5bc4

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed
 

‎src/app/layout/qgslayoutdesignerdialog.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,14 +1065,25 @@ void QgsLayoutDesignerDialog::setCurrentLayout( QgsLayout *layout )
10651065

10661066
void QgsLayoutDesignerDialog::setIconSizes( int size )
10671067
{
1068+
QSize iconSize = QSize( size, size );
1069+
QSize panelIconSize = QgsGuiUtils::panelIconSize( iconSize );
1070+
10681071
//Set the icon size of for all the toolbars created in the future.
1069-
setIconSize( QSize( size, size ) );
1072+
setIconSize( iconSize );
10701073

10711074
//Change all current icon sizes.
10721075
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
10731076
Q_FOREACH ( QToolBar *toolbar, toolbars )
10741077
{
1075-
toolbar->setIconSize( QSize( size, size ) );
1078+
QString className = toolbar->parent()->metaObject()->className();
1079+
if ( className == QLatin1String( "QgsLayoutDesignerDialog" ) )
1080+
{
1081+
toolbar->setIconSize( iconSize );
1082+
}
1083+
else
1084+
{
1085+
toolbar->setIconSize( panelIconSize );
1086+
}
10761087
}
10771088
}
10781089

‎src/app/layout/qgslayoutmapwidget.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#include "qgslayoutundostack.h"
3232
#include "qgslayoutatlas.h"
3333
#include "qgslayoutdesignerinterface.h"
34+
#include "qgsguiutils.h"
35+
3436
#include <QMenu>
3537
#include <QMessageBox>
3638

@@ -86,7 +88,7 @@ QgsLayoutMapWidget::QgsLayoutMapWidget( QgsLayoutItemMap *item )
8688
setPanelTitle( tr( "Map Properties" ) );
8789
mMapRotationSpinBox->setClearValue( 0 );
8890

89-
mDockToolbar->setIconSize( QgisApp::instance()->iconSize( true ) );
91+
mDockToolbar->setIconSize( QgsGuiUtils::iconSize( true ) );
9092

9193
//add widget for general composer item properties
9294
mItemPropertiesWidget = new QgsLayoutItemPropertiesWidget( this, item );

0 commit comments

Comments
 (0)
Please sign in to comment.