2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Redesign web pages preview.

This commit is contained in:
John Preston
2023-10-17 12:57:35 +04:00
parent b9af4f3cb0
commit f8d5a8a203
10 changed files with 241 additions and 177 deletions

View File

@@ -780,9 +780,11 @@ void HistoryMessageReply::paint(
auto replyToTextPosition = QPoint(
x + textLeft,
y + st::historyReplyPadding.top() + st::msgServiceNameFont->height);
const auto replyToTextPalette = &(inBubble
? stm->replyTextPalette
: st->imgReplyTextPalette());
auto replyToTextPalette = &(!inBubble
? st->imgReplyTextPalette()
: _colorIndexPlusOne
? st->coloredTextPalette(selected, _colorIndexPlusOne - 1)
: stm->replyTextPalette);
if (_fields.storyId) {
st::dialogsMiniReplyStory.icon.icon.paint(
p,
@@ -794,6 +796,14 @@ void HistoryMessageReply::paint(
+ st::dialogsMiniReplyStory.icon.icon.width(),
0);
}
auto owned = std::optional<style::owned_color>();
auto copy = std::optional<style::TextPalette>();
if (inBubble && _colorIndexPlusOne) {
copy.emplace(*replyToTextPalette);
owned.emplace(cache->outline);
copy->linkFg = owned->color();
replyToTextPalette = &*copy;
}
_text.draw(p, {
.position = replyToTextPosition,
.availableWidth = w,