mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-03 21:07:53 +00:00
Support custom emoji in chats list entries.
This commit is contained in:
parent
ee8d8171f7
commit
b976aa0872
@ -309,7 +309,7 @@ auto CustomEmojiLoader::InitialState(
|
||||
if (!document->isNull()) {
|
||||
return Lookup{ document };
|
||||
}
|
||||
return Resolve();
|
||||
return Resolve{ .entityData = SerializeCustomEmojiId(id) };
|
||||
}
|
||||
|
||||
void CustomEmojiLoader::cancel() {
|
||||
|
@ -406,6 +406,8 @@ void InnerWidget::changeOpenedFolder(Data::Folder *folder) {
|
||||
void InnerWidget::paintEvent(QPaintEvent *e) {
|
||||
Painter p(this);
|
||||
|
||||
p.setInactive(
|
||||
_controller->isGifPausedAtLeastFor(Window::GifPauseReason::Any));
|
||||
const auto r = e->rect();
|
||||
if (_controller->widget()->contentOverlapped(this, r)) {
|
||||
return;
|
||||
|
@ -20,6 +20,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/unread_badge.h"
|
||||
#include "ui/ui_utility.h"
|
||||
#include "core/ui_integration.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "support/support_helper.h"
|
||||
#include "main/main_session.h"
|
||||
@ -455,6 +456,7 @@ void paintRow(
|
||||
if (!ShowSendActionInDialogs(history)
|
||||
|| !history->sendActionPainter()->paint(p, nameleft, texttop, availableWidth, fullWidth, color, ms)) {
|
||||
if (history->cloudDraftTextCache.isEmpty()) {
|
||||
using namespace TextUtilities;
|
||||
auto draftWrapped = Text::PlainLink(
|
||||
tr::lng_dialogs_text_from_wrapped(
|
||||
tr::now,
|
||||
@ -468,12 +470,23 @@ void paintRow(
|
||||
lt_from_part,
|
||||
draftWrapped,
|
||||
lt_message,
|
||||
{ .text = draft->textWithTags.text },
|
||||
{
|
||||
.text = draft->textWithTags.text,
|
||||
.entities = ConvertTextTagsToEntities(
|
||||
draft->textWithTags.tags),
|
||||
},
|
||||
Text::WithEntities);
|
||||
const auto context = Core::MarkedTextContext{
|
||||
.session = &history->session(),
|
||||
.customEmojiRepaint = [=] {
|
||||
history->updateChatListEntry();
|
||||
},
|
||||
};
|
||||
history->cloudDraftTextCache.setMarkedText(
|
||||
st::dialogsTextStyle,
|
||||
draftText,
|
||||
DialogTextOptions());
|
||||
DialogTextOptions(),
|
||||
context);
|
||||
}
|
||||
p.setPen(active ? st::dialogsTextFgActive : (selected ? st::dialogsTextFgOver : st::dialogsTextFg));
|
||||
if (supportMode) {
|
||||
|
@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "ui/text/text_options.h"
|
||||
#include "ui/text/text_utilities.h"
|
||||
#include "ui/image/image.h"
|
||||
#include "core/ui_integration.h"
|
||||
#include "lang/lang_keys.h"
|
||||
#include "styles/style_dialogs.h"
|
||||
|
||||
@ -126,10 +127,18 @@ void MessageView::paint(
|
||||
_senderCache = { st::dialogsTextWidthMin };
|
||||
}
|
||||
TextUtilities::Trim(preview.text);
|
||||
const auto history = item->history();
|
||||
const auto context = Core::MarkedTextContext{
|
||||
.session = &history->session(),
|
||||
.customEmojiRepaint = [=] {
|
||||
history->updateChatListEntry();
|
||||
},
|
||||
};
|
||||
_textCache.setMarkedText(
|
||||
st::dialogsTextStyle,
|
||||
preview.text,
|
||||
DialogTextOptions());
|
||||
DialogTextOptions(),
|
||||
context);
|
||||
_textCachedFor = item;
|
||||
_imagesCache = std::move(preview.images);
|
||||
if (preview.loadingContext.has_value()) {
|
||||
|
@ -483,7 +483,7 @@ public:
|
||||
private:
|
||||
friend class HistoryBlock;
|
||||
|
||||
enum class Flag {
|
||||
enum class Flag : uchar {
|
||||
HasPendingResizedItems = (1 << 0),
|
||||
UnreadThingsKnown = (1 << 1),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user