Skip to content

Commit

Permalink
handle composer window differently (partly reverts a30eb37)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jan 26, 2012
1 parent 6afdd35 commit e39e766
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
18 changes: 16 additions & 2 deletions src/app/composer/qgscomposer.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,21 @@
#include <QPaintEngine>


QgsComposer::QgsComposer( QgisApp *qgis, const QString& title ): QMainWindow( qgis ), mTitle( title ), mUndoView( 0 )
QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
: QMainWindow()
, mTitle( title )
, mUndoView( 0 )
{
setupUi( this );
setWindowTitle( mTitle );
setupTheme();
QObject::connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );
connect( mButtonBox, SIGNAL( rejected() ), this, SLOT( close() ) );

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

setFontSize( settings.value( "/fontPointSize", QGIS_DEFAULT_FONTSIZE ).toInt() );

QToolButton* orderingToolButton = new QToolButton( this );
orderingToolButton->setPopupMode( QToolButton::InstantPopup );
Expand Down Expand Up @@ -309,6 +318,11 @@ void QgsComposer::setIconSizes( int size )
}
}

void QgsComposer::setFontSize( int fontSize )
{
setStyleSheet( QString( "font-size: %1pt; " ).arg( fontSize ) );
}

void QgsComposer::connectSlots()
{
connect( mView, SIGNAL( selectedItemChanged( QgsComposerItem* ) ), this, SLOT( showItemOptions( QgsComposerItem* ) ) );
Expand Down
1 change: 1 addition & 0 deletions src/app/composer/qgscomposer.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class QgsComposer: public QMainWindow, private Ui::QgsComposerBase
void setupTheme();

void setIconSizes( int size );
void setFontSize( int size );

//! Open and show, set defaults if first time
void open();
Expand Down
10 changes: 7 additions & 3 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1026,6 +1026,11 @@ void QgisApp::createActionGroups()
void QgisApp::setFontSize( int fontSize )
{
setStyleSheet( QString( "font-size: %1pt; " ).arg( fontSize ) );

foreach( QgsComposer *c, mPrintComposers )
{
c->setFontSize( fontSize );
}
}

void QgisApp::createMenus()
Expand Down Expand Up @@ -1403,10 +1408,9 @@ void QgisApp::setIconSizes( int size )
toolbar->setIconSize( QSize( size, size ) );
}

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

Expand Down

0 comments on commit e39e766

Please sign in to comment.