diff --git a/src/modules/plasmalnf/ThemeInfo.cpp b/src/modules/plasmalnf/ThemeInfo.cpp index 69f6818d4..8c922ceef 100644 --- a/src/modules/plasmalnf/ThemeInfo.cpp +++ b/src/modules/plasmalnf/ThemeInfo.cpp @@ -212,6 +212,14 @@ ThemesModel::showOnlyThemes( const QMap< QString, QString >& onlyThese ) emit dataChanged( index( 0, 0 ), index( m_themes->count() - 1 ), { ShownRole } ); } +QSize +ThemesModel::imageSize() +{ + return { qMax( 12 * CalamaresUtils::defaultFontHeight(), 120 ), + qMax( 8 * CalamaresUtils::defaultFontHeight(), 80 ) }; +} + + /** * Massage the given @p path to the most-likely * path that actually contains a screenshot. For @@ -259,8 +267,7 @@ ThemeInfo::loadImage() const if ( pixmap.isNull() ) { - const QSize image_size { qMax( 12 * CalamaresUtils::defaultFontHeight(), 120 ), - qMax( 8 * CalamaresUtils::defaultFontHeight(), 80 ) }; + const QSize image_size( ThemesModel::imageSize() ); const QString path = munge_imagepath( imagePath ); cDebug() << "Loading initial image for" << id << imagePath << "->" << path; diff --git a/src/modules/plasmalnf/ThemeInfo.h b/src/modules/plasmalnf/ThemeInfo.h index 0c4f2fd34..eab2bba6c 100644 --- a/src/modules/plasmalnf/ThemeInfo.h +++ b/src/modules/plasmalnf/ThemeInfo.h @@ -49,6 +49,14 @@ public: /// @brief Shows the keys in the @p onlyThese map, and hides the rest void showOnlyThemes( const QMap< QString, QString >& onlyThese ); + /** @brief The size of theme Images + * + * The size is dependent on the font size used by Calamares, + * and is constant within one run of Calamares, but may change + * if the font settings do between runs. + */ + static QSize imageSize(); + private: ThemeInfoList* m_themes; };