mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
[libcalamaresui] Look up icons via theme
- Don't cache icons, because they could be changed via the active desktop theme.
This commit is contained in:
parent
822bbaad9c
commit
976ad7e3e7
1 changed files with 13 additions and 7 deletions
|
@ -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 );
|
||||
|
||||
if ( pixmap.isNull() )
|
||||
const auto path = imagePath( imageEntry );
|
||||
if ( path.contains( '/' ) )
|
||||
{
|
||||
Q_ASSERT( false );
|
||||
return QPixmap();
|
||||
QPixmap pixmap = ImageRegistry::instance()->pixmap( path, size );
|
||||
|
||||
Q_ASSERT( !pixmap.isNull() );
|
||||
return pixmap;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto icon = QIcon::fromTheme(path);
|
||||
|
||||
Q_ASSERT( !icon.isNull() );
|
||||
return icon.pixmap( size );
|
||||
}
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
QString
|
||||
|
|
Loading…
Add table
Reference in a new issue