Skip to content

Commit

Permalink
Set larger line heights for legend text formats by default, so that w…
Browse files Browse the repository at this point in the history
…e match old rendering appearance
  • Loading branch information
nyalldawson committed Nov 29, 2022
1 parent 34df6d1 commit b4ecf8a
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core/qgslegendsettings.cpp
Expand Up @@ -37,21 +37,30 @@ QgsLegendSettings::QgsLegendSettings()
QgsTextFormat f = rstyle( QgsLegendStyle::Title ).textFormat();
f.setSize( 16.0 );
f.setSizeUnit( QgsUnitTypes::RenderPoints );
// these default line heights are not ideal, but needed to maintain api
f.setLineHeight( 1.1 );
f.setLineHeightUnit( QgsUnitTypes::RenderPercentage );
rstyle( QgsLegendStyle::Title ).setTextFormat( f );

f = rstyle( QgsLegendStyle::Group ).textFormat();
f.setSize( 14.0 );
f.setSizeUnit( QgsUnitTypes::RenderPoints );
f.setLineHeight( 1.1 );
f.setLineHeightUnit( QgsUnitTypes::RenderPercentage );
rstyle( QgsLegendStyle::Group ).setTextFormat( f );

f = rstyle( QgsLegendStyle::Subgroup ).textFormat();
f.setSize( 12.0 );
f.setSizeUnit( QgsUnitTypes::RenderPoints );
f.setLineHeight( 1.1 );
f.setLineHeightUnit( QgsUnitTypes::RenderPercentage );
rstyle( QgsLegendStyle::Subgroup ).setTextFormat( f );

f = rstyle( QgsLegendStyle::SymbolLabel ).textFormat();
f.setSize( 12.0 );
f.setSizeUnit( QgsUnitTypes::RenderPoints );
f.setLineHeight( 1.1 );
f.setLineHeightUnit( QgsUnitTypes::RenderPercentage );
rstyle( QgsLegendStyle::SymbolLabel ).setTextFormat( f );
}

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit b4ecf8a

Please sign in to comment.