Skip to content
Permalink
Browse files

Fixed composer icon sizes

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15204 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman
gsherman committed Feb 19, 2011
1 parent 413331f commit 047a68be3247604aa563bfb12487845de79cb1ea
Showing with 31 additions and 7 deletions.
  1. +17 −0 src/app/composer/qgscomposer.cpp
  2. +2 −0 src/app/composer/qgscomposer.h
  3. +12 −7 src/app/qgisapp.cpp
@@ -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 );
@@ -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* ) ) );
@@ -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();

@@ -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();
@@ -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 )

0 comments on commit 047a68b

Please sign in to comment.