Skip to content

Commit 6befbae

Browse files
committed
[ui] Fix layout designer panel icon (re)sizing
1 parent 94e4de5 commit 6befbae

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/app/layout/qgslayoutdesignerdialog.cpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -1078,15 +1078,26 @@ void QgsLayoutDesignerDialog::setCurrentLayout( QgsLayout *layout )
10781078

10791079
void QgsLayoutDesignerDialog::setIconSizes( int size )
10801080
{
1081+
QSize iconSize = QSize( size, size );
1082+
QSize panelIconSize = QgsGuiUtils::panelIconSize( iconSize );
1083+
10811084
//Set the icon size of for all the toolbars created in the future.
1082-
setIconSize( QSize( size, size ) );
1085+
setIconSize( iconSize );
10831086

10841087
//Change all current icon sizes.
10851088
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
10861089
const auto constToolbars = toolbars;
10871090
for ( QToolBar *toolbar : constToolbars )
10881091
{
1089-
toolbar->setIconSize( QSize( size, size ) );
1092+
QString className = toolbar->parent()->metaObject()->className();
1093+
if ( className == QLatin1String( "QgsLayoutDesignerDialog" ) )
1094+
{
1095+
toolbar->setIconSize( iconSize );
1096+
}
1097+
else
1098+
{
1099+
toolbar->setIconSize( panelIconSize );
1100+
}
10901101
}
10911102
}
10921103

src/app/layout/qgslayoutmapwidget.cpp

+3-1
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)