Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[ui] Fix layout designer panel icon (re)sizing
  • Loading branch information
nirvn committed Apr 17, 2019
1 parent d87c0a2 commit 62a5bc4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
15 changes: 13 additions & 2 deletions src/app/layout/qgslayoutdesignerdialog.cpp
Expand Up @@ -1065,14 +1065,25 @@ 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 *>();
Q_FOREACH ( QToolBar *toolbar, toolbars )
{
toolbar->setIconSize( QSize( size, size ) );
QString className = toolbar->parent()->metaObject()->className();
if ( className == QLatin1String( "QgsLayoutDesignerDialog" ) )
{
toolbar->setIconSize( iconSize );
}
else
{
toolbar->setIconSize( panelIconSize );
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/app/layout/qgslayoutmapwidget.cpp
Expand Up @@ -31,6 +31,8 @@
#include "qgslayoutundostack.h"
#include "qgslayoutatlas.h"
#include "qgslayoutdesignerinterface.h"
#include "qgsguiutils.h"

#include <QMenu>
#include <QMessageBox>

Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit 62a5bc4

Please sign in to comment.