[plasmalnf] Make 'the size of screenshots' available outside ThemeInfo
This commit is contained in:
parent
dac590a094
commit
cc6611bac4
@ -212,6 +212,14 @@ ThemesModel::showOnlyThemes( const QMap< QString, QString >& onlyThese )
|
|||||||
emit dataChanged( index( 0, 0 ), index( m_themes->count() - 1 ), { ShownRole } );
|
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
|
* Massage the given @p path to the most-likely
|
||||||
* path that actually contains a screenshot. For
|
* path that actually contains a screenshot. For
|
||||||
@ -259,8 +267,7 @@ ThemeInfo::loadImage() const
|
|||||||
if ( pixmap.isNull() )
|
if ( pixmap.isNull() )
|
||||||
{
|
{
|
||||||
|
|
||||||
const QSize image_size { qMax( 12 * CalamaresUtils::defaultFontHeight(), 120 ),
|
const QSize image_size( ThemesModel::imageSize() );
|
||||||
qMax( 8 * CalamaresUtils::defaultFontHeight(), 80 ) };
|
|
||||||
|
|
||||||
const QString path = munge_imagepath( imagePath );
|
const QString path = munge_imagepath( imagePath );
|
||||||
cDebug() << "Loading initial image for" << id << imagePath << "->" << path;
|
cDebug() << "Loading initial image for" << id << imagePath << "->" << path;
|
||||||
|
@ -49,6 +49,14 @@ public:
|
|||||||
/// @brief Shows the keys in the @p onlyThese map, and hides the rest
|
/// @brief Shows the keys in the @p onlyThese map, and hides the rest
|
||||||
void showOnlyThemes( const QMap< QString, QString >& onlyThese );
|
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:
|
private:
|
||||||
ThemeInfoList* m_themes;
|
ThemeInfoList* m_themes;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user