-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Right to Left capability to Telegram for languages like arabic, urdu and persian #24467
base: dev
Are you sure you want to change the base?
Changes from all commits
f2c5dd0
fb9cd49
d683ae0
b22cd45
33c2fe7
4f7637a
4b63190
4531441
7e70fd1
e00a501
b882976
e6884c1
def7be6
7d46366
212b04d
e4726d5
2afacb0
16b13f2
946287b
4c663b4
e92da63
4792d49
7784c9b
0079c41
577a333
1012f89
703a91c
40bd013
d4e819a
e2f14e6
dc7e047
77b861e
159c7b5
ca8c16b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -51,15 +51,19 @@ const auto kPsaBadgePrefix = "cloud_lng_badge_psa_"; | |||||||||
|| history->peer->asUser()->onlineTill > 0); | ||||||||||
} | ||||||||||
|
||||||||||
void PaintRowTopRight(Painter &p, const QString &text, QRect &rectForName, bool active, bool selected) { | ||||||||||
void PaintRowTopRight(Painter &p, const QString &text, QRect &rectForName, bool active, bool selected, int outerw = -1) { | ||||||||||
const auto width = st::dialogsDateFont->width(text); | ||||||||||
rectForName.setWidth(rectForName.width() - width - st::dialogsDateSkip); | ||||||||||
p.setFont(st::dialogsDateFont); | ||||||||||
p.setPen(active ? st::dialogsDateFgActive : (selected ? st::dialogsDateFgOver : st::dialogsDateFg)); | ||||||||||
p.drawText(rectForName.left() + rectForName.width() + st::dialogsDateSkip, rectForName.top() + st::msgNameFont->height - st::msgDateFont->descent, text); | ||||||||||
auto left = rectForName.left() + rectForName.width() + st::dialogsDateSkip; | ||||||||||
if (rtl() && outerw > 0){ | ||||||||||
left = outerw - left - width; | ||||||||||
} | ||||||||||
p.drawText(left, rectForName.top() + st::msgNameFont->height - st::msgDateFont->descent, text); | ||||||||||
} | ||||||||||
|
||||||||||
void PaintRowDate(Painter &p, QDateTime date, QRect &rectForName, bool active, bool selected) { | ||||||||||
void PaintRowDate(Painter &p, QDateTime date, QRect &rectForName, bool active, bool selected, int outerw) { | ||||||||||
const auto now = QDateTime::currentDateTime(); | ||||||||||
const auto &lastTime = date; | ||||||||||
const auto nowDate = now.date(); | ||||||||||
|
@@ -77,7 +81,8 @@ void PaintRowDate(Painter &p, QDateTime date, QRect &rectForName, bool active, b | |||||||||
return lastDate.toString(cDateFormat()); | ||||||||||
} | ||||||||||
}(); | ||||||||||
PaintRowTopRight(p, dt, rectForName, active, selected); | ||||||||||
//paints dialogs last message date on each row | ||||||||||
PaintRowTopRight(p, dt, rectForName, active, selected, outerw); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
} | ||||||||||
|
||||||||||
void PaintNarrowCounter( | ||||||||||
|
@@ -102,6 +107,7 @@ void PaintNarrowCounter( | |||||||||
: 3; | ||||||||||
const auto unreadRight = st::dialogsPadding.x() | ||||||||||
+ st::dialogsPhotoSize; | ||||||||||
const auto unreadLeft = st::dialogsPadding.x(); | ||||||||||
const auto unreadTop = st::dialogsPadding.y() | ||||||||||
+ st::dialogsPhotoSize | ||||||||||
- st::dialogsUnreadHeight; | ||||||||||
|
@@ -110,10 +116,14 @@ void PaintNarrowCounter( | |||||||||
st.active = active; | ||||||||||
st.selected = selected; | ||||||||||
st.muted = unreadMuted; | ||||||||||
st.align = rtl() ? style::al_left : style::al_right; | ||||||||||
//paints unread counter or mark badge in narrow dialogs | ||||||||||
const auto badge = PaintUnreadBadge( | ||||||||||
p, | ||||||||||
counter, | ||||||||||
unreadRight, | ||||||||||
(rtl() | ||||||||||
? unreadLeft | ||||||||||
: unreadRight), | ||||||||||
Comment on lines
+124
to
+126
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
unreadTop, | ||||||||||
st, | ||||||||||
allowDigits); | ||||||||||
|
@@ -178,8 +188,10 @@ int PaintWideCounter( | |||||||||
const auto counter = (unreadCount > 0) | ||||||||||
? QString::number(unreadCount) | ||||||||||
: QString(); | ||||||||||
//sets unread counter or unread mark badge coordination | ||||||||||
const auto unreadRight = fullWidth | ||||||||||
- st::dialogsPadding.x(); | ||||||||||
const auto unreadLeft = st::dialogsPadding.x(); | ||||||||||
const auto unreadTop = texttop | ||||||||||
+ st::dialogsTextFont->ascent | ||||||||||
- st::dialogsUnreadFont->ascent | ||||||||||
|
@@ -189,10 +201,14 @@ int PaintWideCounter( | |||||||||
st.active = active; | ||||||||||
st.selected = selected; | ||||||||||
st.muted = unreadMuted; | ||||||||||
st.align = rtl() ? style::al_left : style::al_right; | ||||||||||
//paints unread counter or unread mark badge | ||||||||||
const auto badge = PaintUnreadBadge( | ||||||||||
p, | ||||||||||
counter, | ||||||||||
unreadRight, | ||||||||||
(rtl() | ||||||||||
? unreadLeft | ||||||||||
: unreadRight), | ||||||||||
Comment on lines
+209
to
+211
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
unreadTop, | ||||||||||
st); | ||||||||||
availableWidth -= badge.width() + st.padding; | ||||||||||
|
@@ -204,6 +220,7 @@ int PaintWideCounter( | |||||||||
: selected | ||||||||||
? st::dialogsPinnedIconOver | ||||||||||
: st::dialogsPinnedIcon; | ||||||||||
//paints pinned icon on dialogs if unread counter or unread mark doesn't exist | ||||||||||
icon.paint( | ||||||||||
p, | ||||||||||
fullWidth - st::dialogsPadding.x() - icon.width(), | ||||||||||
|
@@ -215,9 +232,11 @@ int PaintWideCounter( | |||||||||
} | ||||||||||
if (displayMentionBadge || displayReactionBadge) { | ||||||||||
const auto counter = QString(); | ||||||||||
//mention or reaction badge coordination | ||||||||||
const auto unreadRight = fullWidth | ||||||||||
- st::dialogsPadding.x() | ||||||||||
- (initial - availableWidth); | ||||||||||
const auto unreadLeft = st::dialogsPadding.x() + (initial - availableWidth); | ||||||||||
const auto unreadTop = texttop | ||||||||||
+ st::dialogsTextFont->ascent | ||||||||||
- st::dialogsUnreadFont->ascent | ||||||||||
|
@@ -232,12 +251,13 @@ int PaintWideCounter( | |||||||||
st.muted = mentionOrReactionMuted; | ||||||||||
st.padding = 0; | ||||||||||
st.textTop = 0; | ||||||||||
st.align = rtl() ? style::al_left : style::al_right; | ||||||||||
const auto badge = PaintUnreadBadge( | ||||||||||
p, | ||||||||||
counter, | ||||||||||
unreadRight, | ||||||||||
rtl() ? unreadLeft : unreadRight, | ||||||||||
unreadTop, | ||||||||||
st); | ||||||||||
st); /**paints mention or reaction badge*/ | ||||||||||
(displayMentionBadge | ||||||||||
? (st.active | ||||||||||
? st::dialogsUnreadMentionActive | ||||||||||
|
@@ -248,7 +268,7 @@ int PaintWideCounter( | |||||||||
? st::dialogsUnreadReactionActive | ||||||||||
: st.selected | ||||||||||
? st::dialogsUnreadReactionOver | ||||||||||
: st::dialogsUnreadReaction)).paintInCenter(p, badge); | ||||||||||
: st::dialogsUnreadReaction)).paintInCenter(p, badge); /**paints mention or reaction inner icon at the center*/ | ||||||||||
availableWidth -= badge.width() | ||||||||||
+ st.padding | ||||||||||
+ (hadOneBadge ? st::dialogsUnreadPadding : 0); | ||||||||||
|
@@ -372,6 +392,7 @@ void paintRow( | |||||||||
fullWidth, | ||||||||||
st::dialogsPhotoSize); | ||||||||||
} else { | ||||||||||
//Archived Chats folder goes here | ||||||||||
entry->paintUserpicLeft( | ||||||||||
p, | ||||||||||
row->userpicView(), | ||||||||||
|
@@ -410,9 +431,11 @@ void paintRow( | |||||||||
: custom.isEmpty() | ||||||||||
? tr::lng_badge_psa_default(tr::now) | ||||||||||
: custom; | ||||||||||
PaintRowTopRight(p, text, rectForName, active, selected); | ||||||||||
//paints promoted chat's type for example "proxy sponsor" | ||||||||||
PaintRowTopRight(p, text, rectForName, active, selected, fullWidth); | ||||||||||
} else if (from) { | ||||||||||
if (const auto chatTypeIcon = ChatTypeIcon(from, active, selected)) { | ||||||||||
//paints chat type icon(it's rtl compatible due to lib_ui function usage) | ||||||||||
chatTypeIcon->paint(p, rectForName.topLeft(), fullWidth); | ||||||||||
rectForName.setLeft(rectForName.left() + st::dialogsChatTypeSkip); | ||||||||||
} | ||||||||||
|
@@ -435,7 +458,8 @@ void paintRow( | |||||||||
|| (supportMode | ||||||||||
&& entry->session().supportHelper().isOccupiedBySomeone(history))) { | ||||||||||
if (!promoted) { | ||||||||||
PaintRowDate(p, date, rectForName, active, selected); | ||||||||||
//paints date when drafts exists | ||||||||||
PaintRowDate(p , date, rectForName, active, selected, fullWidth); | ||||||||||
} | ||||||||||
|
||||||||||
auto availableWidth = namewidth; | ||||||||||
|
@@ -495,7 +519,8 @@ void paintRow( | |||||||||
} | ||||||||||
} else if (!item->isEmpty()) { | ||||||||||
if (history && !promoted) { | ||||||||||
PaintRowDate(p, date, rectForName, active, selected); | ||||||||||
//paints date | ||||||||||
PaintRowDate(p, date, rectForName, active, selected, fullWidth); | ||||||||||
} | ||||||||||
|
||||||||||
paintItemCallback(nameleft, namewidth); | ||||||||||
|
@@ -582,14 +607,16 @@ void paintRow( | |||||||||
: selected | ||||||||||
? st::dialogsNameFgOver | ||||||||||
: st::dialogsNameFg); | ||||||||||
from->nameText().drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); | ||||||||||
//draw chat's name | ||||||||||
from->nameText().drawLeftElided(p, rectForName.left(), rectForName.top(), rectForName.width(), fullWidth, 1); | ||||||||||
} else if (hiddenSenderInfo) { | ||||||||||
p.setPen(active | ||||||||||
? st::dialogsNameFgActive | ||||||||||
: selected | ||||||||||
? st::dialogsNameFgOver | ||||||||||
: st::dialogsNameFg); | ||||||||||
hiddenSenderInfo->nameText.drawElided(p, rectForName.left(), rectForName.top(), rectForName.width()); | ||||||||||
//draw chat's name when hidden sender info exists | ||||||||||
hiddenSenderInfo->nameText.drawLeftElided(p, rectForName.left(), rectForName.top(), rectForName.width(), fullWidth); | ||||||||||
} else { | ||||||||||
p.setPen(active | ||||||||||
? st::dialogsNameFgActive | ||||||||||
|
@@ -889,8 +916,11 @@ void RowPainter::paint( | |||||||||
: (selected | ||||||||||
? st::dialogsTextFgServiceOver | ||||||||||
: st::dialogsTextFgService); | ||||||||||
//creates rect for last message in each dialog | ||||||||||
const auto itemRect = QRect( | ||||||||||
nameleft, | ||||||||||
(rtl() | ||||||||||
? fullWidth - nameleft - availableWidth | ||||||||||
: nameleft), | ||||||||||
Comment on lines
+921
to
+923
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
texttop, | ||||||||||
availableWidth, | ||||||||||
st::dialogsTextFont->height); | ||||||||||
|
@@ -1128,7 +1158,11 @@ void PaintCollapsedRow( | |||||||||
const auto left = narrow | ||||||||||
? ((fullWidth - st::semiboldFont->width(text)) / 2) | ||||||||||
: st::dialogsPadding.x(); | ||||||||||
p.drawText(left, textBaseline, text); | ||||||||||
const auto right = (narrow | ||||||||||
? (fullWidth - st::semiboldFont->width(text)) / 2 | ||||||||||
: (fullWidth - st::semiboldFont->width(text) - st::dialogsPadding.x())); | ||||||||||
//draws achived chats title when collapsed | ||||||||||
p.drawText(rtl() ? right : left, textBaseline, text); | ||||||||||
} else { | ||||||||||
folder->paintUserpicLeft( | ||||||||||
p, | ||||||||||
|
@@ -1140,12 +1174,17 @@ void PaintCollapsedRow( | |||||||||
} | ||||||||||
if (!narrow && unread) { | ||||||||||
const auto unreadRight = fullWidth - st::dialogsPadding.x(); | ||||||||||
const auto unreadLeft = st::dialogsPadding.x(); | ||||||||||
UnreadBadgeStyle st; | ||||||||||
st.muted = true; | ||||||||||
st.align = rtl() ? style::al_left : style::al_right; | ||||||||||
//paints unread counter badge in collapsed archived folder in wide mode | ||||||||||
PaintUnreadBadge( | ||||||||||
p, | ||||||||||
QString::number(unread), | ||||||||||
unreadRight, | ||||||||||
(rtl() | ||||||||||
? unreadLeft | ||||||||||
: unreadRight), | ||||||||||
Comment on lines
+1185
to
+1187
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
unreadTop, | ||||||||||
st); | ||||||||||
} | ||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -164,7 +164,9 @@ void MessageView::paint( | |||||||||
if (!_senderCache.isEmpty()) { | ||||||||||
_senderCache.drawElided( | ||||||||||
p, | ||||||||||
rect.left(), | ||||||||||
(rtl() | ||||||||||
? (geometry.left() + geometry.right() - rect.left() - _senderCache.maxWidth()) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't use |
||||||||||
: rect.left()), | ||||||||||
rect.top(), | ||||||||||
rect.width(), | ||||||||||
rect.height() / st::dialogsTextFont->height); | ||||||||||
|
@@ -177,7 +179,9 @@ void MessageView::paint( | |||||||||
break; | ||||||||||
} | ||||||||||
p.drawImage( | ||||||||||
rect.x(), | ||||||||||
(rtl() | ||||||||||
? (geometry.left() + geometry.right() - rect.left() - st::dialogsMiniPreview) | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please don't use |
||||||||||
: rect.x()), | ||||||||||
rect.y() + st::dialogsMiniPreviewTop, | ||||||||||
image.data); | ||||||||||
rect.setLeft(rect.x() | ||||||||||
|
@@ -192,7 +196,9 @@ void MessageView::paint( | |||||||||
} | ||||||||||
_textCache.drawElided( | ||||||||||
p, | ||||||||||
rect.left(), | ||||||||||
(rtl() | ||||||||||
? geometry.left() | ||||||||||
: rect.left()), | ||||||||||
Comment on lines
+199
to
+201
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
rect.top(), | ||||||||||
rect.width(), | ||||||||||
rect.height() / st::dialogsTextFont->height); | ||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2193,7 +2193,9 @@ void MainWidget::updateControlsGeometry() { | |||||||||
if (_thirdSection) { | ||||||||||
auto thirdSectionTop = getThirdSectionTop(); | ||||||||||
_thirdSection->setGeometry( | ||||||||||
width() - thirdSectionWidth, | ||||||||||
(rtl() | ||||||||||
? 0 | ||||||||||
: width() - thirdSectionWidth), | ||||||||||
Comment on lines
+2196
to
+2198
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
thirdSectionTop, | ||||||||||
thirdSectionWidth, | ||||||||||
height() - thirdSectionTop); | ||||||||||
|
@@ -2238,7 +2240,9 @@ void MainWidget::updateControlsGeometry() { | |||||||||
_callTopBarHeight + _exportTopBarHeight); | ||||||||||
} | ||||||||||
_history->setGeometryWithTopMoved(QRect( | ||||||||||
dialogsWidth, | ||||||||||
(rtl() | ||||||||||
? thirdSectionWidth | ||||||||||
: dialogsWidth), | ||||||||||
Comment on lines
+2243
to
+2245
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
mainSectionTop, | ||||||||||
mainSectionWidth, | ||||||||||
height() - mainSectionTop | ||||||||||
|
@@ -2275,7 +2279,9 @@ void MainWidget::refreshResizeAreas() { | |||||||||
if (!isOneColumn()) { | ||||||||||
ensureFirstColumnResizeAreaCreated(); | ||||||||||
_firstColumnResizeArea->setGeometryToLeft( | ||||||||||
_history->x(), | ||||||||||
(rtl() | ||||||||||
? _dialogsWidth | ||||||||||
: _history->x()), | ||||||||||
Comment on lines
+2282
to
+2284
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
0, | ||||||||||
st::historyResizeWidth, | ||||||||||
height()); | ||||||||||
|
@@ -2286,7 +2292,9 @@ void MainWidget::refreshResizeAreas() { | |||||||||
if (isThreeColumn() && _thirdSection) { | ||||||||||
ensureThirdColumnResizeAreaCreated(); | ||||||||||
_thirdColumnResizeArea->setGeometryToLeft( | ||||||||||
_thirdSection->x(), | ||||||||||
(rtl() | ||||||||||
? (width() - _thirdSection->width()) | ||||||||||
: _thirdSection->x()), | ||||||||||
Comment on lines
+2295
to
+2297
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
0, | ||||||||||
st::historyResizeWidth, | ||||||||||
height()); | ||||||||||
|
@@ -2315,6 +2323,9 @@ void MainWidget::ensureFirstColumnResizeAreaCreated() { | |||||||||
} | ||||||||||
auto moveLeftCallback = [=](int globalLeft) { | ||||||||||
auto newWidth = globalLeft - mapToGlobal(QPoint(0, 0)).x(); | ||||||||||
newWidth = rtl() | ||||||||||
? width() - newWidth | ||||||||||
: newWidth; | ||||||||||
Comment on lines
+2326
to
+2328
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
auto newRatio = (newWidth < st::columnMinimalWidthLeft / 2) | ||||||||||
? 0. | ||||||||||
: float64(newWidth) / width(); | ||||||||||
|
@@ -2342,6 +2353,9 @@ void MainWidget::ensureThirdColumnResizeAreaCreated() { | |||||||||
} | ||||||||||
auto moveLeftCallback = [=](int globalLeft) { | ||||||||||
auto newWidth = mapToGlobal(QPoint(width(), 0)).x() - globalLeft; | ||||||||||
newWidth = rtl() | ||||||||||
? (width() - newWidth) | ||||||||||
: newWidth; | ||||||||||
Comment on lines
+2356
to
+2358
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
Core::App().settings().setThirdColumnWidth(newWidth); | ||||||||||
}; | ||||||||||
auto moveFinishedCallback = [=] { | ||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -76,12 +76,21 @@ void DrawScamFakeBadge( | |||||||||||||||||||||||
p.setBrush(Qt::NoBrush); | ||||||||||||||||||||||||
p.drawRoundedRect(rect, st::dialogsScamRadius, st::dialogsScamRadius); | ||||||||||||||||||||||||
p.setFont(st::dialogsScamFont); | ||||||||||||||||||||||||
p.drawTextLeft( | ||||||||||||||||||||||||
rect.x() + st::dialogsScamPadding.left(), | ||||||||||||||||||||||||
rect.y() + st::dialogsScamPadding.top(), | ||||||||||||||||||||||||
outerWidth, | ||||||||||||||||||||||||
phrase, | ||||||||||||||||||||||||
phraseWidth); | ||||||||||||||||||||||||
if (rtl()) { | ||||||||||||||||||||||||
p.drawTextRight( | ||||||||||||||||||||||||
rect.x() + st::dialogsScamPadding.left(), | ||||||||||||||||||||||||
rect.y() + st::dialogsScamPadding.top(), | ||||||||||||||||||||||||
outerWidth, | ||||||||||||||||||||||||
phrase, | ||||||||||||||||||||||||
phraseWidth); | ||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||
p.drawTextLeft( | ||||||||||||||||||||||||
rect.x() + st::dialogsScamPadding.left(), | ||||||||||||||||||||||||
rect.y() + st::dialogsScamPadding.top(), | ||||||||||||||||||||||||
outerWidth, | ||||||||||||||||||||||||
phrase, | ||||||||||||||||||||||||
phraseWidth); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
void DrawScamBadge( | ||||||||||||||||||||||||
|
@@ -128,11 +137,11 @@ int DrawPeerBadgeGetWidth( | |||||||||||||||||||||||
const auto height = st::dialogsScamPadding.top() | ||||||||||||||||||||||||
+ st::dialogsScamFont->height | ||||||||||||||||||||||||
+ st::dialogsScamPadding.bottom(); | ||||||||||||||||||||||||
auto x = (rtl() | ||||||||||||||||||||||||
? rectForName.right() - qMin(nameWidth + st::dialogsScamSkip, rectForName.width() - width) - width | ||||||||||||||||||||||||
: rectForName.x() + qMin(nameWidth + st::dialogsScamSkip, rectForName.width() - width)); | ||||||||||||||||||||||||
Comment on lines
+140
to
+142
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
const auto rect = QRect( | ||||||||||||||||||||||||
(rectForName.x() | ||||||||||||||||||||||||
+ qMin( | ||||||||||||||||||||||||
nameWidth + st::dialogsScamSkip, | ||||||||||||||||||||||||
rectForName.width() - width)), | ||||||||||||||||||||||||
x, | ||||||||||||||||||||||||
rectForName.y() + (rectForName.height() - height) / 2, | ||||||||||||||||||||||||
width, | ||||||||||||||||||||||||
height); | ||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.