Skip to content

Commit

Permalink
Fix pin icon is also not shown correctly in news feed
Browse files Browse the repository at this point in the history
Follow up 637e996
  • Loading branch information
nyalldawson authored and github-actions[bot] committed Jan 23, 2023
1 parent 3787618 commit 1b38d10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/qgsprojectlistitemdelegate.cpp
Expand Up @@ -113,7 +113,7 @@ QSize QgsProjectListItemDelegate::sizeHint( const QStyleOptionViewItem &option,

doc.setHtml( QStringLiteral( "<div style='font-size:%1px;'><span style='font-size:%2px;font-weight:bold;'>%3%4</span><br>%5<br>%6</div>" ).arg( textSize ).arg( titleSize )
.arg( index.data( QgsProjectListItemDelegate::TitleRole ).toString(),
index.data( QgsProjectListItemDelegate::PinRole ).toBool() ? QStringLiteral( "<img src=\"qrc:/images/themes/default/pin.svg\">" ) : QString(),
index.data( QgsProjectListItemDelegate::PinRole ).toBool() ? QStringLiteral( "<img src=\":/images/themes/default/pin.svg\">" ) : QString(),
index.data( QgsProjectListItemDelegate::NativePathRole ).toString(),
index.data( QgsProjectListItemDelegate::CrsRole ).toString() ) );
doc.setTextWidth( width - ( !icon.isNull() ? icon.width() + 4.375 * mRoundedRectSizePixels : 4.375 * mRoundedRectSizePixels ) );
Expand Down Expand Up @@ -232,7 +232,7 @@ void QgsNewsItemListItemDelegate::paint( QPainter *painter, const QStyleOptionVi

doc.setHtml( QStringLiteral( "<div style='font-size:%1px'><span style='font-size:%2px;font-weight:bold;'>%3%4</span>%5</div>" ).arg( textSize ).arg( QString::number( titleSize ),
index.data( QgsNewsFeedModel::Title ).toString(),
index.data( QgsNewsFeedModel::Sticky ).toBool() ? QStringLiteral( "<img src=\"qrc:/images/themes/default/pin.svg\">" ) : QString(),
index.data( QgsNewsFeedModel::Sticky ).toBool() ? QStringLiteral( "<img src=\":/images/themes/default/pin.svg\">" ) : QString(),
index.data( QgsNewsFeedModel::Content ).toString() ) );


Expand Down Expand Up @@ -273,7 +273,7 @@ QSize QgsNewsItemListItemDelegate::sizeHint( const QStyleOptionViewItem &option,
const int textSize = titleSize * 0.85;
doc.setHtml( QStringLiteral( "<div style='font-size:%1px'><span style='font-size:%2px;font-weight:bold;'>%3%4</span>%5</div>" ).arg( textSize ).arg( QString::number( titleSize ),
index.data( QgsNewsFeedModel::Title ).toString(),
index.data( QgsNewsFeedModel::Sticky ).toBool() ? QStringLiteral( "<img src=\"qrc:/images/themes/default/pin.svg\">" ) : QString(),
index.data( QgsNewsFeedModel::Sticky ).toBool() ? QStringLiteral( "<img src=\":/images/themes/default/pin.svg\">" ) : QString(),
index.data( QgsNewsFeedModel::Content ).toString() ) );
doc.setTextWidth( width - ( !icon.isNull() ? icon.width() + 4.375 * mRoundedRectSizePixels : 4.375 * mRoundedRectSizePixels ) );

Expand Down

0 comments on commit 1b38d10

Please sign in to comment.