[plasmalnf] Improve screenshot view

- make screenies smaller
 - use view-preview to indicate no-screenshot-specified
This commit is contained in:
Adriaan de Groot 2017-12-19 12:28:42 +01:00
parent 10e71bab30
commit f2aeecf546
2 changed files with 9 additions and 2 deletions

View File

@ -10,6 +10,8 @@ calamares_add_plugin( plasmalnf
PlasmaLnfPage.cpp
PlasmaLnfJob.cpp
ThemeWidget.cpp
RESOURCES
page_plasmalnf.qrc
UI
page_plasmalnf.ui
LINK_PRIVATE_LIBRARIES

View File

@ -37,10 +37,15 @@ ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent)
layout->addWidget( m_check, 1 );
constexpr QSize image_size{240, 160};
constexpr QSize image_size{120, 80};
QPixmap image( info.imagePath );
if ( image.isNull() )
if ( info.imagePath.isEmpty() )
{
// Image can't possibly be valid
image = QPixmap( ":/view-preview.png" );
}
else if ( image.isNull() )
{
// Not found or not specified, so convert the name into some (horrible, likely)
// color instead.