Skip to content

Commit 5466306

Browse files
author
gsherman
committed
Fixed composer icon sizes
git-svn-id: http://svn.osgeo.org/qgis/trunk@15204 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 501d1c9 commit 5466306

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

src/app/composer/qgscomposer.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title ): QMainWindow(),
7878
setupTheme();
7979
QObject::connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );
8080

81+
QSettings settings;
82+
int size = settings.value( "/IconSize", 24 ).toInt();
83+
setIconSize(QSize(size,size));
84+
8185
QToolButton* orderingToolButton = new QToolButton( this );
8286
orderingToolButton->setPopupMode( QToolButton::InstantPopup );
8387
orderingToolButton->setAutoRaise( true );
@@ -296,6 +300,19 @@ void QgsComposer::setupTheme()
296300
mActionAlignBottom->setIcon( QgisApp::getThemeIcon( "/mActionAlignBottom.png" ) );
297301
}
298302

303+
void QgsComposer::setIconSizes( int size )
304+
{
305+
//Set the icon size of for all the toolbars created in the future.
306+
setIconSize(QSize(size,size));
307+
308+
//Change all current icon sizes.
309+
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
310+
foreach(QToolBar * toolbar, toolbars)
311+
{
312+
toolbar->setIconSize(QSize(size,size));
313+
}
314+
}
315+
299316
void QgsComposer::connectSlots()
300317
{
301318
connect( mView, SIGNAL( selectedItemChanged( QgsComposerItem* ) ), this, SLOT( showItemOptions( QgsComposerItem* ) ) );

src/app/composer/qgscomposer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
5858
//! Set the pixmap / icons on the toolbar buttons
5959
void setupTheme();
6060

61+
void setIconSizes( int size );
62+
6163
//! Open and show, set defaults if first time
6264
void open();
6365

src/app/qgisapp.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
420420
mUndoWidget = new QgsUndoWidget( NULL, mMapCanvas );
421421
mUndoWidget->setObjectName( "Undo" );
422422

423-
//Set the icon size for all the toolbars.
424423
createActions();
425424
createActionGroups();
426425
createMenus();
@@ -2050,12 +2049,18 @@ void QgisApp::setIconSizes( int size )
20502049
//Set the icon size of for all the toolbars created in the future.
20512050
setIconSize( QSize( size, size ) );
20522051

2053-
//Change all current icon sizes.
2054-
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
2055-
foreach( QToolBar * toolbar, toolbars )
2056-
{
2057-
toolbar->setIconSize( QSize( size, size ) );
2058-
}
2052+
//Change all current icon sizes.
2053+
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
2054+
foreach( QToolBar * toolbar, toolbars )
2055+
{
2056+
toolbar->setIconSize( QSize( size, size ) );
2057+
}
2058+
2059+
QSet<QgsComposer*>::iterator composerIt = mPrintComposers.begin();
2060+
for ( ; composerIt != mPrintComposers.end(); ++composerIt )
2061+
{
2062+
( *composerIt )->setIconSizes(size);
2063+
}
20592064
}
20602065

20612066
void QgisApp::setTheme( QString theThemeName )

0 commit comments

Comments
 (0)