[welcome] Use convenience image loader from Branding

This commit is contained in:
Adriaan de Groot 2019-05-31 17:26:30 +02:00
parent 07c638ed48
commit f54b7dee9f
3 changed files with 7 additions and 5 deletions

View File

@ -271,9 +271,9 @@ WelcomePage::externallySelectedLanguage( int row )
} }
void void
WelcomePage::setLanguageIcon( QIcon i ) WelcomePage::setLanguageIcon( QPixmap i )
{ {
ui->languageIcon->setPixmap( i.pixmap(48) ); ui->languageIcon->setPixmap( i );
} }

View File

@ -43,7 +43,7 @@ public:
bool showKnownIssuesUrl, bool showKnownIssuesUrl,
bool showReleaseNotesUrl ); bool showReleaseNotesUrl );
/// @brief Set international language-selector icon /// @brief Set international language-selector icon
void setLanguageIcon( QIcon ); void setLanguageIcon( QPixmap );
/// @brief Results of requirements checking /// @brief Results of requirements checking
bool verdict() const; bool verdict() const;

View File

@ -24,10 +24,12 @@
#include "geoip/Handler.h" #include "geoip/Handler.h"
#include "locale/Lookup.h" #include "locale/Lookup.h"
#include "modulesystem/ModuleManager.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/Variant.h" #include "utils/Variant.h"
#include "Branding.h"
#include "modulesystem/ModuleManager.h"
#include <QFutureWatcher> #include <QFutureWatcher>
#include <QVariant> #include <QVariant>
@ -142,7 +144,7 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
QString language = CalamaresUtils::getString( configurationMap, "languageIcon" ); QString language = CalamaresUtils::getString( configurationMap, "languageIcon" );
if ( !language.isEmpty() ) if ( !language.isEmpty() )
{ {
auto icon = QIcon::fromTheme( language ); auto icon = Calamares::Branding::instance()->image( language, QSize( 48, 48 ) );
if ( !icon.isNull() ) if ( !icon.isNull() )
m_widget->setLanguageIcon( icon ); m_widget->setLanguageIcon( icon );
} }