Skip to content

Commit

Permalink
Added param to switch between circle and square avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
23rd committed Jun 12, 2017
1 parent fb2ade9 commit da0eb90
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Telegram/SourceFiles/ui/images.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ const QPixmap &circleMask(int width, int height) {
p.fillRect(0, 0, width, height, Qt::transparent);
p.setBrush(Qt::white);
p.setPen(Qt::NoPen);
p.drawRect(0, 0, width, height);

QStringList args = QApplication::arguments();
int index = args.indexOf("-square-avatars");
if (index >= 0) {
p.drawRect(0, 0, width, height);
} else {
p.drawEllipse(0, 0, width, height);
}
}
mask.setDevicePixelRatio(cRetinaFactor());
i = masks.insert(key, App::pixmapFromImageInPlace(std::move(mask)));
Expand Down

0 comments on commit da0eb90

Please sign in to comment.