Commit 7ceb1a44 by JanKusanagi

Calculate subtle size only in one place

parent dde5fc80
......@@ -310,6 +310,7 @@ MinorFeedItem::MinorFeedItem(ASActivity *activity,
// Handle the different styles to prepare the paintEvent()
this->verbIconSize = globalObj->getMfAvatarSize().width();
this->verbIconSizeSubtle = verbIconSize * 1.4;
if (verbIconType == 1 || verbIconType == 3)
{
......@@ -317,7 +318,7 @@ MinorFeedItem::MinorFeedItem(ASActivity *activity,
}
else
{
iconSpacing = (verbIconSize * 1.4) / 2; // FIXME: 140% increase should not be hardcoded
iconSpacing = verbIconSizeSubtle / 2;
}
}
......@@ -572,8 +573,6 @@ void MinorFeedItem::paintEvent(QPaintEvent *event)
//////////// FIXME - TODO -- This needs a lot of optimizing all around
QSize iconSize = QSize(verbIconSize, verbIconSize);
QIcon icon = QIcon::fromTheme(verbIcons.first(),
QIcon(verbIcons.last()));
......@@ -587,7 +586,7 @@ void MinorFeedItem::paintEvent(QPaintEvent *event)
int iconOffset = 0;
if (subtle)
{
iconPixmap = icon.pixmap(iconSize *= 1.4); // FIXME: 140% increase should not be hardcoded
iconPixmap = icon.pixmap(verbIconSizeSubtle, verbIconSizeSubtle);
if (verbIconType == 4) // icon-after, subtle
{
iconOffset = verbIconSize / 2; // Based on original icon size
......@@ -595,7 +594,7 @@ void MinorFeedItem::paintEvent(QPaintEvent *event)
}
else
{
iconPixmap = icon.pixmap(iconSize);
iconPixmap = icon.pixmap(verbIconSize, verbIconSize);
if (verbIconType == 3) // icon-after
{
iconOffset = verbIconSize + this->topLayout->spacing();
......
......@@ -92,6 +92,7 @@ private:
int verbIconType;
QStringList verbIcons;
int verbIconSize;
int verbIconSizeSubtle;
AvatarButton *avatarButton;
QLabel *timestampLabel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment