[libcalamaresui] Look up icons via theme

- Don't cache icons, because they could be changed via
   the active desktop theme.
main
Adriaan de Groot 6 years ago
parent 822bbaad9c
commit 976ad7e3e7

@ -297,15 +297,21 @@ Branding::imagePath( Branding::ImageEntry imageEntry ) const
QPixmap
Branding::image( Branding::ImageEntry imageEntry, const QSize& size ) const
{
QPixmap pixmap =
ImageRegistry::instance()->pixmap( imagePath( imageEntry ), size );
const auto path = imagePath( imageEntry );
if ( path.contains( '/' ) )
{
QPixmap pixmap = ImageRegistry::instance()->pixmap( path, size );
if ( pixmap.isNull() )
Q_ASSERT( !pixmap.isNull() );
return pixmap;
}
else
{
Q_ASSERT( false );
return QPixmap();
auto icon = QIcon::fromTheme(path);
Q_ASSERT( !icon.isNull() );
return icon.pixmap( size );
}
return pixmap;
}
QString

Loading…
Cancel
Save