mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Added mini icon to messages with reply to story.
This commit is contained in:
parent
70e298cfe4
commit
1493b23574
1 changed files with 28 additions and 7 deletions
|
@ -43,6 +43,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "api/api_bot.h"
|
#include "api/api_bot.h"
|
||||||
#include "styles/style_widgets.h"
|
#include "styles/style_widgets.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
#include "styles/style_dialogs.h" // dialogsMiniReplyStoryIcon.
|
||||||
|
|
||||||
#include <QtGui/QGuiApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
|
|
||||||
|
@ -460,7 +461,14 @@ void HistoryMessageReply::updateName(
|
||||||
w += st::msgServiceFont->spacew + replyToVia->maxWidth;
|
w += st::msgServiceFont->spacew + replyToVia->maxWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
maxReplyWidth = previewSkip + qMax(w, qMin(replyToText.maxWidth(), int32(st::maxSignatureSize)));
|
maxReplyWidth = previewSkip
|
||||||
|
+ std::max(
|
||||||
|
w,
|
||||||
|
std::min(replyToText.maxWidth(), st::maxSignatureSize))
|
||||||
|
+ (storyReply
|
||||||
|
? (st::dialogsMiniIconSkip
|
||||||
|
+ st::dialogsMiniReplyStoryIcon.icon.width())
|
||||||
|
: 0);
|
||||||
} else {
|
} else {
|
||||||
maxReplyWidth = st::msgDateFont->width(statePhrase());
|
maxReplyWidth = st::msgDateFont->width(statePhrase());
|
||||||
}
|
}
|
||||||
|
@ -596,14 +604,27 @@ void HistoryMessageReply::paint(
|
||||||
? stm->historyTextFg
|
? stm->historyTextFg
|
||||||
: st->msgImgReplyBarColor());
|
: st->msgImgReplyBarColor());
|
||||||
holder->prepareCustomEmojiPaint(p, context, replyToText);
|
holder->prepareCustomEmojiPaint(p, context, replyToText);
|
||||||
|
auto replyToTextPosition = QPoint(
|
||||||
|
x + st::msgReplyBarSkip + previewSkip,
|
||||||
|
y + st::msgReplyPadding.top() + st::msgServiceNameFont->height);
|
||||||
|
const auto replyToTextPalette = &(inBubble
|
||||||
|
? stm->replyTextPalette
|
||||||
|
: st->imgReplyTextPalette());
|
||||||
|
if (storyReply) {
|
||||||
|
st::dialogsMiniReplyStoryIcon.icon.paint(
|
||||||
|
p,
|
||||||
|
replyToTextPosition,
|
||||||
|
w - st::msgReplyBarSkip - previewSkip,
|
||||||
|
replyToTextPalette->linkFg->c);
|
||||||
|
replyToTextPosition += QPoint(
|
||||||
|
st::dialogsMiniIconSkip
|
||||||
|
+ st::dialogsMiniReplyStoryIcon.icon.width(),
|
||||||
|
0);
|
||||||
|
}
|
||||||
replyToText.draw(p, {
|
replyToText.draw(p, {
|
||||||
.position = QPoint(
|
.position = replyToTextPosition,
|
||||||
x + st::msgReplyBarSkip + previewSkip,
|
|
||||||
y + st::msgReplyPadding.top() + st::msgServiceNameFont->height),
|
|
||||||
.availableWidth = w - st::msgReplyBarSkip - previewSkip,
|
.availableWidth = w - st::msgReplyBarSkip - previewSkip,
|
||||||
.palette = &(inBubble
|
.palette = replyToTextPalette,
|
||||||
? stm->replyTextPalette
|
|
||||||
: st->imgReplyTextPalette()),
|
|
||||||
.spoiler = Ui::Text::DefaultSpoilerCache(),
|
.spoiler = Ui::Text::DefaultSpoilerCache(),
|
||||||
.now = context.now,
|
.now = context.now,
|
||||||
.pausedEmoji = (context.paused
|
.pausedEmoji = (context.paused
|
||||||
|
|
Loading…
Add table
Reference in a new issue