Skip to content

Commit

Permalink
Fixed composer icon sizes
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@15204 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman committed Feb 19, 2011
1 parent 501d1c9 commit 5466306
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
17 changes: 17 additions & 0 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -78,6 +78,10 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title ): QMainWindow(),
setupTheme();
QObject::connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );

QSettings settings;
int size = settings.value( "/IconSize", 24 ).toInt();
setIconSize(QSize(size,size));

QToolButton* orderingToolButton = new QToolButton( this );
orderingToolButton->setPopupMode( QToolButton::InstantPopup );
orderingToolButton->setAutoRaise( true );
Expand Down Expand Up @@ -296,6 +300,19 @@ void QgsComposer::setupTheme()
mActionAlignBottom->setIcon( QgisApp::getThemeIcon( "/mActionAlignBottom.png" ) );
}

void QgsComposer::setIconSizes( int size )
{
//Set the icon size of for all the toolbars created in the future.
setIconSize(QSize(size,size));

//Change all current icon sizes.
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
foreach(QToolBar * toolbar, toolbars)
{
toolbar->setIconSize(QSize(size,size));
}
}

void QgsComposer::connectSlots()
{
connect( mView, SIGNAL( selectedItemChanged( QgsComposerItem* ) ), this, SLOT( showItemOptions( QgsComposerItem* ) ) );
Expand Down
2 changes: 2 additions & 0 deletions src/app/composer/qgscomposer.h
Expand Up @@ -58,6 +58,8 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
//! Set the pixmap / icons on the toolbar buttons
void setupTheme();

void setIconSizes( int size );

//! Open and show, set defaults if first time
void open();

Expand Down
19 changes: 12 additions & 7 deletions src/app/qgisapp.cpp
Expand Up @@ -420,7 +420,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
mUndoWidget = new QgsUndoWidget( NULL, mMapCanvas );
mUndoWidget->setObjectName( "Undo" );

//Set the icon size for all the toolbars.
createActions();
createActionGroups();
createMenus();
Expand Down Expand Up @@ -2050,12 +2049,18 @@ void QgisApp::setIconSizes( int size )
//Set the icon size of for all the toolbars created in the future.
setIconSize( QSize( size, size ) );

//Change all current icon sizes.
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
foreach( QToolBar * toolbar, toolbars )
{
toolbar->setIconSize( QSize( size, size ) );
}
//Change all current icon sizes.
QList<QToolBar *> toolbars = findChildren<QToolBar *>();
foreach( QToolBar * toolbar, toolbars )
{
toolbar->setIconSize( QSize( size, size ) );
}

QSet<QgsComposer*>::iterator composerIt = mPrintComposers.begin();
for ( ; composerIt != mPrintComposers.end(); ++composerIt )
{
( *composerIt )->setIconSizes(size);
}
}

void QgisApp::setTheme( QString theThemeName )
Expand Down

0 comments on commit 5466306

Please sign in to comment.