mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-02 07:25:46 +00:00
Alpha 1.0.10: unpinning converted chat on demand.
If we want to pin a chat and we have reached the limit we now check for a deactivated (converted to supergroup) chat that is pinned and is not in the chats list and just silently unpin it if it is found. Also possible UB fix for a waveform encoding and decoding.
This commit is contained in:
@@ -109,15 +109,27 @@ void paintRow(Painter &p, const RippleRow *row, History *history, HistoryItem *i
|
||||
p.restoreTextPalette();
|
||||
}
|
||||
} else if (!item) {
|
||||
auto availableWidth = namewidth;
|
||||
if (history->isPinnedDialog()) {
|
||||
auto &icon = (active ? st::dialogsPinnedIconActive : (selected ? st::dialogsPinnedIconOver : st::dialogsPinnedIcon));
|
||||
icon.paint(p, fullWidth - st::dialogsPadding.x() - icon.width(), texttop, fullWidth);
|
||||
availableWidth -= icon.width() + st::dialogsUnreadPadding;
|
||||
}
|
||||
|
||||
auto &color = active ? st::dialogsTextFgServiceActive : (selected ? st::dialogsTextFgServiceOver : st::dialogsTextFgService);
|
||||
p.setFont(st::dialogsTextFont);
|
||||
if (!history->paintSendAction(p, nameleft, texttop, namewidth, fullWidth, color, ms)) {
|
||||
if (!history->paintSendAction(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
|
||||
// Empty history
|
||||
}
|
||||
} else if (!item->isEmpty()) {
|
||||
paintRowDate(p, date, rectForName, active, selected);
|
||||
|
||||
paintItemCallback(nameleft, namewidth, item);
|
||||
} else if (history->isPinnedDialog()) {
|
||||
auto availableWidth = namewidth;
|
||||
auto &icon = (active ? st::dialogsPinnedIconActive : (selected ? st::dialogsPinnedIconOver : st::dialogsPinnedIcon));
|
||||
icon.paint(p, fullWidth - st::dialogsPadding.x() - icon.width(), texttop, fullWidth);
|
||||
availableWidth -= icon.width() + st::dialogsUnreadPadding;
|
||||
}
|
||||
auto sendStateIcon = ([draft, item, active, selected]() -> const style::icon* {
|
||||
if (draft) {
|
||||
|
Reference in New Issue
Block a user