Feature: allow disable welcome-logo resizing

main
Adriaan de Groot 8 years ago
parent c4f955874d
commit 44e6955f19

@ -8,6 +8,10 @@ componentName: default
# same distribution.
welcomeStyleCalamares: false
# Should the welcome image (productWelcome, below) be scaled
# up beyond its natural size?
welcomeExpandingLogo: true
strings:
productName: Generic GNU/Linux
shortProductName: Generic

@ -110,6 +110,7 @@ Branding::Branding( const QString& brandingFilePath,
bail( "Syntax error in strings map." );
m_welcomeStyleCalamares = doc[ "welcomeStyleCalamares" ].as< bool >( false );
m_welcomeExpandingLogo = doc[ "welcomeExpandingLogo" ].as< bool >( true );
QVariantMap strings =
CalamaresUtils::yamlMapToVariant( doc[ "strings" ] ).toMap();
@ -276,12 +277,6 @@ Branding::slideshowPath() const
return m_slideshowPath;
}
bool
Branding::welcomeStyleCalamares() const
{
return m_welcomeStyleCalamares;
}
void
Branding::setGlobals( GlobalStorage* globalStorage ) const
{

@ -88,7 +88,8 @@ public:
QPixmap image( Branding::ImageEntry imageEntry, const QSize& size ) const;
QString slideshowPath() const;
bool welcomeStyleCalamares() const;
bool welcomeStyleCalamares() const { return m_welcomeStyleCalamares; }
bool welcomeExpandingLogo() const { return m_welcomeExpandingLogo; }
/**
* Creates a map called "branding" in the global storage, and inserts an
@ -115,6 +116,7 @@ private:
QString m_translationsPathPrefix;
bool m_welcomeStyleCalamares;
bool m_welcomeExpandingLogo;
};
template<typename U> inline QString operator*(U e) { return Branding::instance()->string( e ); }

@ -128,13 +128,23 @@ CheckerWidget::init( const QList< PrepareEntry >& checkEntries )
imagePath( Calamares::Branding::ProductWelcome ) );
if ( !theImage.isNull() )
{
FixedAspectRatioLabel* imageLabel = new FixedAspectRatioLabel;
QLabel* imageLabel;
if ( Calamares::Branding::instance()->welcomeExpandingLogo() )
{
FixedAspectRatioLabel *p = new FixedAspectRatioLabel;
p->setPixmap( theImage );
imageLabel = p;
}
else
{
imageLabel = new QLabel;
imageLabel->setPixmap( theImage );
}
imageLabel->setContentsMargins( 4, CalamaresUtils::defaultFontHeight() * 3 / 4, 4, 4 );
m_mainLayout->addWidget( imageLabel );
imageLabel->setAlignment( Qt::AlignCenter );
imageLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
imageLabel->setPixmap( theImage );
}
}
CALAMARES_RETRANSLATE(

Loading…
Cancel
Save