From ac06f31e1f50e2ca07645a67877b41be4908b9b8 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 5 Jul 2020 16:18:07 +0200 Subject: [PATCH] only scale instrument picture if its width is too large for Compact skin --- src/audiomixerboard.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index 529757a1..379c87eb 100755 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -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;