only scale instrument picture if its width is too large for Compact skin

This commit is contained in:
Volker Fischer 2020-07-05 16:18:07 +02:00
parent b8ba6ce8db
commit ac06f31e1f

View file

@ -614,14 +614,16 @@ void CChannelFader::SetChannelInfos ( const CChannelInfo& cChanInfo )
else
{
// set correct picture
if ( iInstrPicFixedWidth != INVALID_INDEX )
QPixmap pixInstr ( strCurResourceRef );
if ( ( iInstrPicFixedWidth != INVALID_INDEX ) && ( pixInstr.width() > iInstrPicFixedWidth ) )
{
// scale instrument picture on request (scale to the width with correct aspect ratio)
plblInstrument->setPixmap ( QPixmap ( strCurResourceRef ).scaledToWidth ( iInstrPicFixedWidth, Qt::SmoothTransformation ) );
plblInstrument->setPixmap ( pixInstr.scaledToWidth ( iInstrPicFixedWidth, Qt::SmoothTransformation ) );
}
else
{
plblInstrument->setPixmap ( QPixmap ( strCurResourceRef ) );
plblInstrument->setPixmap ( pixInstr );
}
iTTInstrument = cChanInfo.iInstrument;