summary refs log tree commit diff
path: root/src/RoomInfoListItem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/RoomInfoListItem.cpp')
-rw-r--r--src/RoomInfoListItem.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp

index dbcd6806..8aadbea2 100644 --- a/src/RoomInfoListItem.cpp +++ b/src/RoomInfoListItem.cpp
@@ -19,6 +19,7 @@ #include <QDebug> #include <QMouseEvent> #include <QPainter> +#include <QSettings> #include <QtGlobal> #include "AvatarProvider.h" @@ -141,6 +142,8 @@ RoomInfoListItem::resizeEvent(QResizeEvent *) void RoomInfoListItem::paintEvent(QPaintEvent *event) { + bool rounded = QSettings().value("user/avatar/circles", true).toBool(); + Q_UNUSED(event); QPainter p(this); @@ -288,7 +291,8 @@ 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, 3, 3); QFont bubbleFont; bubbleFont.setPointSizeF(bubbleFont.pointSizeF() * 1.4); @@ -301,7 +305,9 @@ 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, 3, 3); + p.setClipPath(path); p.drawPixmap(avatarRegion, roomAvatar_);