diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp
index 9bcce134..0ff4a00f 100644
--- a/src/RoomInfoListItem.cpp
+++ b/src/RoomInfoListItem.cpp
@@ -287,7 +287,11 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
p.setPen(Qt::NoPen);
p.setBrush(brush);
- p.drawEllipse(avatarRegion.center(), wm.iconSize / 2, wm.iconSize / 2);
+ rounded_ ?
+ p.drawEllipse(avatarRegion.center(), wm.iconSize / 2, wm.iconSize / 2) :
+ p.drawRoundedRect( avatarRegion,
+ AVATAR_RECT_ROUND,
+ AVATAR_RECT_ROUND);
QFont bubbleFont;
bubbleFont.setPointSizeF(bubbleFont.pointSizeF() * 1.4);
@@ -300,7 +304,12 @@ RoomInfoListItem::paintEvent(QPaintEvent *event)
p.save();
QPainterPath path;
- path.addEllipse(wm.padding, wm.padding, wm.iconSize, wm.iconSize);
+ rounded_ ?
+ path.addEllipse(wm.padding, wm.padding, wm.iconSize, wm.iconSize) :
+ path.addRoundedRect( avatarRegion,
+ AVATAR_RECT_ROUND,
+ AVATAR_RECT_ROUND);
+
p.setClipPath(path);
p.drawPixmap(avatarRegion, roomAvatar_);
@@ -446,3 +455,9 @@ RoomInfoListItem::setDescriptionMessage(const DescInfo &info)
lastMsgInfo_ = info;
update();
}
+
+void
+RoomInfoListItem::setRounded(bool setting)
+{
+ rounded_ = setting;
+}
|