[welcome] Allow theming the international language-select icon

This commit is contained in:
Adriaan de Groot 2019-05-31 16:59:38 +02:00
parent 75ce391e7e
commit 07c638ed48
5 changed files with 31 additions and 1 deletions

View File

@ -270,6 +270,12 @@ WelcomePage::externallySelectedLanguage( int row )
ui->languageWidget->setCurrentIndex( row );
}
void
WelcomePage::setLanguageIcon( QIcon i )
{
ui->languageIcon->setPixmap( i.pixmap(48) );
}
void
LocaleTwoColumnDelegate::paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const

View File

@ -42,6 +42,8 @@ public:
void setUpLinks( bool showSupportUrl,
bool showKnownIssuesUrl,
bool showReleaseNotesUrl );
/// @brief Set international language-selector icon
void setLanguageIcon( QIcon );
/// @brief Results of requirements checking
bool verdict() const;

View File

@ -67,7 +67,7 @@
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<widget class="QLabel" name="languageIcon">
<property name="toolTip">
<string>Select language</string>
</property>

View File

@ -137,6 +137,15 @@ WelcomeViewStep::setConfigurationMap( const QVariantMap& configurationMap )
} );
future->setFuture( handler->queryRaw() );
}
QString language = CalamaresUtils::getString( configurationMap, "languageIcon" );
if ( !language.isEmpty() )
{
auto icon = QIcon::fromTheme( language );
if ( !icon.isNull() )
m_widget->setLanguageIcon( icon );
}
}
Calamares::RequirementsList

View File

@ -64,3 +64,16 @@ geoip:
style: "none"
url: "https://geoip.kde.org/v1/ubiquity" # extended XML format
selector: "CountryCode" # blank uses default, which is wrong
# User interface
#
# The "select language" icon is an international standard, but it
# might not theme very well with your desktop environment.
# Fill in an icon name (following FreeDesktop standards) to
# use that named icon instead of the usual one.
#
# Leave blank or unset to use the international standard.
#
# Known icons in this space are "set-language" and "config-language".
#
# languageIcon: set-language