Skip to content

Commit 9e0bfde

Browse files
committed
slightly improved userpic corners
1 parent f6032fa commit 9e0bfde

File tree

10 files changed

+15
-28
lines changed

10 files changed

+15
-28
lines changed

Telegram/SourceFiles/boxes/peer_list_box.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,6 @@ void PeerListRow::paintDisabledCheckUserpic(
888888
p.setPen(userpicBorderPen);
889889
p.setBrush(Qt::NoBrush);
890890
p.drawEllipse(userpicEllipse);
891-
// p.drawRoundedRect(userpicEllipse, RabbitSettings::JsonSettings::GetInt("userpic_roundness"), RabbitSettings::JsonSettings::GetInt("userpic_roundness"));
892891

893892
p.setPen(iconBorderPen);
894893
p.setBrush(st.disabledCheckFg);

Telegram/SourceFiles/calls/calls_userpic.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ void Userpic::paint() {
107107
_muteSize,
108108
_muteSize);
109109
p.drawEllipse(rect);
110-
// p.drawRoundedRect(rect, RabbitSettings::JsonSettings::GetInt("userpic_roundness"), RabbitSettings::JsonSettings::GetInt("userpic_roundness"));
111110
st::callMutedPeerIcon.paintInCenter(p, rect);
112111
}
113112
}

Telegram/SourceFiles/data/data_folder.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ void Folder::paintUserpic(
270270
p.setBrush(overrideBg ? *overrideBg : st::historyPeerArchiveUserpicBg);
271271
{
272272
PainterHighQualityEnabler hq(p);
273-
// p.drawEllipse(x, y, size, size);
274-
p.drawRoundedRect(x, y, size, size, size * (RabbitSettings::JsonSettings::GetInt("userpic_roundness")) / 100, size * (RabbitSettings::JsonSettings::GetInt("userpic_roundness")) / 100);
273+
auto radius = RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100. * size;
274+
p.drawRoundedRect(x, y, size, size, radius, radius);
275275
}
276276
if (size == st::defaultDialogRow.photoSize) {
277277
const auto rect = QRect{ x, y, size, size };

Telegram/SourceFiles/data/data_peer.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -353,12 +353,11 @@ void PeerData::paintUserpic(
353353
QImage image = view.cached;
354354
roundedRect.addRoundedRect(
355355
QRect(x, y, size, size),
356-
size * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100,
357-
size * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100);
356+
size * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100.,
357+
size * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100.);
358358
p.setClipPath(roundedRect);
359359
p.drawImage(x, y, image);
360360
p.restore();
361-
/* p.drawImage(QRect(x, y, size, size), view.cached); */
362361
}
363362

364363
void PeerData::loadUserpic() {

Telegram/SourceFiles/dialogs/ui/dialogs_video_userpic.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,12 @@ void VideoUserpic::paintLeft(
100100
QImage image = _video->current(request(size), now);
101101
roundedRect.addRoundedRect(
102102
QRect(x, y, image.height(), image.width()),
103-
image.height() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100,
104-
image.width() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100);
103+
image.width() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100,
104+
image.height() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100);
105105
p.setClipPath(roundedRect);
106106
p.drawImage(x, y, image);
107107

108108
p.restore();
109-
/* p.drawImage(x, y, _video->current(request(size), now)); */
110109
} else {
111110
_peer->paintUserpicLeft(p, view, x, y, w, size);
112111
}

Telegram/SourceFiles/history/view/media/history_view_poll.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,8 @@ void Poll::paintRecentVoters(
919919
p.setPen(pen);
920920
p.setBrush(Qt::NoBrush);
921921
PainterHighQualityEnabler hq(p);
922-
p.drawEllipse(x, y, size, size);
923-
// p.drawRoundedRect(x, y, size, size, RabbitSettings::JsonSettings::GetInt("userpic_roundness"), RabbitSettings::JsonSettings::GetInt("userpic_roundness"));
922+
auto radius = RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100. * size;
923+
p.drawRoundedRect(x, y, size, size, radius, radius);
924924
};
925925
if (usesBubblePattern(context)) {
926926
const auto add = st::lineWidth * 2;

Telegram/SourceFiles/ui/effects/outline_segments.cpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,12 @@ void PaintOutlineSegments(
2020

2121
p.setBrush(Qt::NoBrush);
2222
const auto count = std::min(int(segments.size()), kOutlineSegmentsMax);
23-
// if (count == 1 /* || (RabbitSettings::JsonSettings::GetInt("userpic_roundness") != 100) */) {
24-
p.setPen(QPen(segments.front().brush, segments.front().width));
25-
// p.drawEllipse(ellipse);
26-
p.drawRoundedRect(
27-
ellipse,
28-
ellipse.height() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") * 0.0102,
29-
ellipse.width() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") * 0.0102);
30-
return;
23+
p.setPen(QPen(segments.front().brush, segments.front().width));
24+
p.drawRoundedRect(
25+
ellipse,
26+
ellipse.height() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") * 0.0102,
27+
ellipse.width() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") * 0.0102);
28+
return;
3129
// }
3230
/* const auto small = 160;
3331
const auto full = arc::kFullLength;

Telegram/SourceFiles/ui/effects/round_checkbox.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,6 @@ void RoundImageCheckbox::paint(Painter &p, int x, int y, int outerWidth) const {
417417
segments ? _segments.front().width : _st.selectWidth);
418418
p.setPen(pen);
419419
if (!radius) {
420-
// p.drawEllipse(outline);
421420
p.drawRoundedRect(
422421
outline,
423422
outline.height() * RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100,

Telegram/SourceFiles/ui/empty_userpic.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,6 @@ void EmptyUserpic::paintCircle(
325325
int y,
326326
int outerWidth,
327327
int size) const {
328-
/* paint(p, x, y, outerWidth, size, [&] {
329-
p.drawEllipse(x, y, size, size);
330-
}); */
331-
332328
paint(p, x, y, outerWidth, size, [&] {
333329
double customRadius = (double) size * ((double) RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100);
334330
p.drawRoundedRect(x, y, size, size,
@@ -391,7 +387,6 @@ void EmptyUserpic::PaintSavedMessages(
391387
PainterHighQualityEnabler hq(p);
392388
p.setBrush(std::move(bg));
393389
p.setPen(Qt::NoPen);
394-
// p.drawEllipse(x, y, size, size);
395390
double customRadius = (double) size * ((double) RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100);
396391
p.drawRoundedRect(x, y, size, size,
397392
customRadius, customRadius);
@@ -433,7 +428,6 @@ void EmptyUserpic::PaintRepliesMessages(
433428
PainterHighQualityEnabler hq(p);
434429
p.setBrush(bg);
435430
p.setPen(Qt::NoPen);
436-
// p.drawEllipse(x, y, size, size);
437431
double customRadius = (double) size * ((double) RabbitSettings::JsonSettings::GetInt("userpic_roundness") / 100);
438432
p.drawRoundedRect(x, y, size, size,
439433
customRadius, customRadius);

Telegram/build/setup.iss

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define MyAppId "4356CE01-4137-4C55-9F8B-FB4EEBB6EC0C"
99
#define CurrentYear GetDateTimeString('yyyy','','')
1010
#define MyBuildTarget "win64"
11-
#define MyAppVersionFull "5.1.8-18062024"
11+
#define MyAppVersionFull "5.1.8-20062024"
1212

1313
[Setup]
1414
; NOTE: The value of AppId uniquely identifies this application.

0 commit comments

Comments
 (0)