Skip to content
Permalink
Browse files

[ui] Fix layout designer panel icon (re)sizing

  • Loading branch information
nirvn committed Apr 17, 2019
1 parent 94e4de5 commit 6befbae7bf50152f6cba88ddc8a3d63badc06207
Showing with 16 additions and 3 deletions.
  1. +13 −2 src/app/layout/qgslayoutdesignerdialog.cpp
  2. +3 −1 src/app/layout/qgslayoutmapwidget.cpp
@@ -1078,15 +1078,26 @@ void QgsLayoutDesignerDialog::setCurrentLayout( QgsLayout *layout )

void QgsLayoutDesignerDialog::setIconSizes( int size )
{
QSize iconSize = QSize( size, size );
QSize panelIconSize = QgsGuiUtils::panelIconSize( iconSize );

//Set the icon size of for all the toolbars created in the future.
setIconSize( QSize( size, size ) );
setIconSize( iconSize );

//Change all current icon sizes.
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
const auto constToolbars = toolbars;
for ( QToolBar *toolbar : constToolbars )
{
toolbar->setIconSize( QSize( size, size ) );
QString className = toolbar->parent()->metaObject()->className();
if ( className == QLatin1String( "QgsLayoutDesignerDialog" ) )
{
toolbar->setIconSize( iconSize );
}
else
{
toolbar->setIconSize( panelIconSize );
}
}
}

@@ -31,6 +31,8 @@
#include "qgslayoutundostack.h"
#include "qgslayoutatlas.h"
#include "qgslayoutdesignerinterface.h"
#include "qgsguiutils.h"

#include <QMenu>
#include <QMessageBox>

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

mDockToolbar->setIconSize( QgisApp::instance()->iconSize( true ) );
mDockToolbar->setIconSize( QgsGuiUtils::iconSize( true ) );

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

0 comments on commit 6befbae

Please sign in to comment.
You can’t perform that action at this time.