Skip to content

Commit

Permalink
Update for issue #5692
Browse files Browse the repository at this point in the history
- Qt font dialog on Mac inherits app font if app is in ancestry (make dialog parentless)
  • Loading branch information
dakcarto committed Oct 3, 2012
1 parent abcc4bf commit d8c7c15
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
3 changes: 0 additions & 3 deletions src/app/composer/qgscomposer.cpp
Expand Up @@ -85,10 +85,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
QSettings settings;
int size = settings.value( "/IconSize", QGIS_ICON_SIZE ).toInt();
setIconSize( QSize( size, size ) );

#ifndef Q_WS_MAC
setFontSize( settings.value( "/fontPointSize", QGIS_DEFAULT_FONTSIZE ).toInt() );
#endif

QToolButton* orderingToolButton = new QToolButton( this );
orderingToolButton->setPopupMode( QToolButton::InstantPopup );
Expand Down
8 changes: 4 additions & 4 deletions src/app/composer/qgscomposerlegendwidget.cpp
Expand Up @@ -209,7 +209,7 @@ void QgsComposerLegendWidget::on_mTitleFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->titleFont() );
#endif
Expand All @@ -231,7 +231,7 @@ void QgsComposerLegendWidget::on_mGroupFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->groupFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mLegend->groupFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->groupFont() );
#endif
Expand All @@ -253,7 +253,7 @@ void QgsComposerLegendWidget::on_mLayerFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->layerFont() );
#endif
Expand All @@ -275,7 +275,7 @@ void QgsComposerLegendWidget::on_mItemFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mLegend->itemFont() );
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposermapwidget.cpp
Expand Up @@ -749,7 +749,7 @@ void QgsComposerMapWidget::on_mAnnotationFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mComposerMap->gridAnnotationFont() );
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdecorationgriddialog.cpp
Expand Up @@ -277,7 +277,7 @@ void QgsDecorationGridDialog::on_mAnnotationFontButton_clicked()
bool ok;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
QFont newFont = QFontDialog::getFont( &ok, mDeco.gridAnnotationFont(), this, QString(), QFontDialog::DontUseNativeDialog );
QFont newFont = QFontDialog::getFont( &ok, mDeco.gridAnnotationFont(), 0, QString(), QFontDialog::DontUseNativeDialog );
#else
QFont newFont = QFontDialog::getFont( &ok, mDeco.gridAnnotationFont() );
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgslabeldialog.cpp
Expand Up @@ -282,9 +282,9 @@ void QgsLabelDialog::changeFont( void )
bool resultFlag;
#if defined(Q_WS_MAC) && QT_VERSION >= 0x040500 && defined(QT_MAC_USE_COCOA)
// Native Mac dialog works only for Qt Carbon
mFont = QFontDialog::getFont( &resultFlag, mFont, this, QString(), QFontDialog::DontUseNativeDialog );
mFont = QFontDialog::getFont( &resultFlag, mFont, 0, QString(), QFontDialog::DontUseNativeDialog );
#else
mFont = QFontDialog::getFont( &resultFlag, mFont, this );
mFont = QFontDialog::getFont( &resultFlag, mFont);
#endif
if ( !resultFlag )
return;
Expand Down

0 comments on commit d8c7c15

Please sign in to comment.