mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Added mini icon to drafts with reply.
This commit is contained in:
parent
4288ba2449
commit
b78443cf2d
2 changed files with 14 additions and 2 deletions
|
@ -496,6 +496,8 @@ dialogsMiniForward: DialogsMiniIcon {
|
|||
skipMedia: 2px;
|
||||
}
|
||||
|
||||
dialogsMiniReplyIcon: icon {{ "mini_forward-flip_horizontal", attentionButtonFg, point(0px, 2px) }};
|
||||
|
||||
dialogsMiniReplyStory: DialogsMiniIcon {
|
||||
icon: ThreeStateIcon {
|
||||
icon: icon {{ "mini_reply_story", dialogsTextFg, point(0px, 1px) }};
|
||||
|
|
|
@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "data/data_forum_topic.h"
|
||||
#include "data/data_saved_sublist.h"
|
||||
#include "data/data_session.h"
|
||||
#include "data/stickers/data_custom_emoji.h"
|
||||
#include "dialogs/dialogs_list.h"
|
||||
#include "dialogs/dialogs_three_state_icon.h"
|
||||
#include "dialogs/ui/dialogs_video_userpic.h"
|
||||
|
@ -468,7 +469,7 @@ void PaintRow(
|
|||
: tr::lng_dialogs_text_with_from(
|
||||
tr::now,
|
||||
lt_from_part,
|
||||
draftWrapped,
|
||||
std::move(draftWrapped),
|
||||
lt_message,
|
||||
DialogsPreviewText({
|
||||
.text = draft->textWithTags.text,
|
||||
|
@ -476,13 +477,22 @@ void PaintRow(
|
|||
draft->textWithTags.tags),
|
||||
}),
|
||||
Text::WithEntities);
|
||||
if (draft && draft->reply) {
|
||||
auto &data = thread->owner().customEmojiManager();
|
||||
const auto internal = data.registerInternalEmoji(
|
||||
st::dialogsMiniReplyIcon,
|
||||
{},
|
||||
false);
|
||||
draftText = Ui::Text::SingleCustomEmoji(
|
||||
std::move(internal)).append(std::move(draftText));
|
||||
}
|
||||
const auto context = Core::MarkedTextContext{
|
||||
.session = &thread->session(),
|
||||
.customEmojiRepaint = customEmojiRepaint,
|
||||
};
|
||||
cache.setMarkedText(
|
||||
st::dialogsTextStyle,
|
||||
draftText,
|
||||
std::move(draftText),
|
||||
DialogTextOptions(),
|
||||
context);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue