mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 23:27:09 +02:00
Fixed paint of mini icon in dialogs list even there is no space for it.
This commit is contained in:
parent
7740780eeb
commit
738aff9c4f
1 changed files with 15 additions and 9 deletions
|
@ -328,15 +328,23 @@ void MessageView::paint(
|
|||
*_leftIcon,
|
||||
context.active,
|
||||
context.selected);
|
||||
if (_hasPlainLinkAtBegin && !context.active) {
|
||||
icon.paint(p, rect.topLeft(), rect.width(), palette->linkFg->c);
|
||||
} else {
|
||||
icon.paint(p, rect.topLeft(), rect.width());
|
||||
const auto w = (icon.width());
|
||||
if (rect.width() > w) {
|
||||
if (_hasPlainLinkAtBegin && !context.active) {
|
||||
icon.paint(
|
||||
p,
|
||||
rect.topLeft(),
|
||||
rect.width(),
|
||||
palette->linkFg->c);
|
||||
} else {
|
||||
icon.paint(p, rect.topLeft(), rect.width());
|
||||
}
|
||||
rect.setLeft(rect.x() + w + st::dialogsMiniIconSkip);
|
||||
}
|
||||
rect.setLeft(rect.x() + icon.width() + st::dialogsMiniIconSkip);
|
||||
}
|
||||
for (const auto &image : _imagesCache) {
|
||||
if (rect.width() < st::dialogsMiniPreview) {
|
||||
const auto w = st::dialogsMiniPreview + st::dialogsMiniPreviewSkip;
|
||||
if (rect.width() < w) {
|
||||
break;
|
||||
}
|
||||
const auto mini = QRect(
|
||||
|
@ -352,9 +360,7 @@ void MessageView::paint(
|
|||
FillSpoilerRect(p, mini, frame);
|
||||
}
|
||||
}
|
||||
rect.setLeft(rect.x()
|
||||
+ st::dialogsMiniPreview
|
||||
+ st::dialogsMiniPreviewSkip);
|
||||
rect.setLeft(rect.x() + w);
|
||||
}
|
||||
if (!_imagesCache.empty()) {
|
||||
rect.setLeft(rect.x() + st::dialogsMiniPreviewRight);
|
||||
|
|
Loading…
Add table
Reference in a new issue