Skip to content

Commit 4f43282

Browse files
committed
Don't set app stylesheet font/font size if it isn't changed from
the default Potentially avoids some hidpi scaling issues
1 parent 728b9fc commit 4f43282

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app/qgisappstylesheet.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant> &opts )
103103
QgsDebugMsg( QStringLiteral( "fontFamily: %1" ).arg( fontFamily ) );
104104
if ( fontFamily.isEmpty() ) { return; }
105105

106-
ss += QStringLiteral( "* { font: %1pt \"%2\"} " ).arg( fontSize, fontFamily );
106+
const QString defaultSize = QString::number( mDefaultFont.pointSize() );
107+
const QString defaultFamily = mDefaultFont.family();
108+
if ( fontSize != defaultSize || fontFamily != defaultFamily )
109+
ss += QStringLiteral( "* { font: %1pt \"%2\"} " ).arg( fontSize, fontFamily );
107110

108111
#if QT_VERSION >= 0x050900
109112
// Fix for macOS Qt 5.9+, where close boxes do not show on document mode tab bar tabs

0 commit comments

Comments
 (0)