From 2dec1b72f752971c0818901d871384a20aa96716 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 13 Jan 2022 16:22:42 +0300 Subject: [PATCH] Rename reactionBottom* to reactionInline* styles. --- .../data/data_message_reactions.cpp | 2 +- .../history/view/history_view_reactions.cpp | 28 +++++++++---------- Telegram/SourceFiles/ui/chat/chat.style | 12 ++++---- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Telegram/SourceFiles/data/data_message_reactions.cpp b/Telegram/SourceFiles/data/data_message_reactions.cpp index a80413a6b..5730d5922 100644 --- a/Telegram/SourceFiles/data/data_message_reactions.cpp +++ b/Telegram/SourceFiles/data/data_message_reactions.cpp @@ -142,7 +142,7 @@ QImage Reactions::resolveImageFor( }; if (set.bottomInfo.isNull() && set.icon) { resolve(set.bottomInfo, st::reactionInfoImage); - resolve(set.inlineList, st::reactionBottomImage); + resolve(set.inlineList, st::reactionInlineImage); crl::async([icon = std::move(set.icon)]{}); } switch (size) { diff --git a/Telegram/SourceFiles/history/view/history_view_reactions.cpp b/Telegram/SourceFiles/history/view/history_view_reactions.cpp index d46a589cd..1b33b7448 100644 --- a/Telegram/SourceFiles/history/view/history_view_reactions.cpp +++ b/Telegram/SourceFiles/history/view/history_view_reactions.cpp @@ -117,15 +117,15 @@ QSize InlineList::countOptimalSize() { return _skipBlock; } const auto left = (_data.flags & InlineListData::Flag::InBubble) - ? st::reactionBottomInBubbleLeft + ? st::reactionInlineInBubbleLeft : 0; auto x = left; - const auto between = st::reactionBottomBetween; - const auto padding = st::reactionBottomPadding; - const auto size = st::reactionBottomSize; + const auto between = st::reactionInlineBetween; + const auto padding = st::reactionInlinePadding; + const auto size = st::reactionInlineSize; const auto widthBase = padding.left() + size - + st::reactionBottomSkip + + st::reactionInlineSkip + padding.right(); const auto height = padding.top() + size + padding.bottom(); for (auto &button : _buttons) { @@ -143,9 +143,9 @@ QSize InlineList::countCurrentSize(int newWidth) { return optimalSize(); } using Flag = InlineListData::Flag; - const auto between = st::reactionBottomBetween; + const auto between = st::reactionInlineBetween; const auto inBubble = (_data.flags & Flag::InBubble); - const auto left = inBubble ? st::reactionBottomInBubbleLeft : 0; + const auto left = inBubble ? st::reactionInlineInBubbleLeft : 0; auto x = left; auto y = 0; for (auto &button : _buttons) { @@ -186,9 +186,9 @@ void InlineList::paint( const QRect &clip) const { const auto st = context.st; const auto stm = context.messageStyle(); - const auto padding = st::reactionBottomPadding; - const auto size = st::reactionBottomSize; - const auto skip = (size - st::reactionBottomImage) / 2; + const auto padding = st::reactionInlinePadding; + const auto size = st::reactionInlineSize; + const auto skip = (size - st::reactionInlineImage) / 2; const auto inbubble = (_data.flags & InlineListData::Flag::InBubble); const auto animated = (_animation && context.reactionEffects) ? _animation->playingAroundEmoji() @@ -234,7 +234,7 @@ void InlineList::paint( } const auto image = QRect( inner.topLeft() + QPoint(skip, skip), - QSize(st::reactionBottomImage, st::reactionBottomImage)); + QSize(st::reactionInlineImage, st::reactionInlineImage)); if (!button.image.isNull() && !skipImage) { p.drawImage(image.topLeft(), button.image); } @@ -260,7 +260,7 @@ void InlineList::paint( const auto textTop = geometry.y() + ((geometry.height() - st::semiboldFont->height) / 2); p.drawText( - inner.x() + size + st::reactionBottomSkip, + inner.x() + size + st::reactionInlineSkip, textTop + st::semiboldFont->ascent, button.countText); } @@ -271,7 +271,7 @@ bool InlineList::getState( QPoint point, not_null outResult) const { const auto left = (_data.flags & InlineListData::Flag::InBubble) - ? st::reactionBottomInBubbleLeft + ? st::reactionInlineInBubbleLeft : 0; if (!QRect(left, 0, width() - left, height()).contains(point)) { return false; @@ -296,7 +296,7 @@ void InlineList::animateSend( _owner, std::move(args), std::move(repaint), - st::reactionBottomImage); + st::reactionInlineImage); } std::unique_ptr InlineList::takeSendAnimation() { diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index c25ce1ab5..d08021ac3 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -963,12 +963,12 @@ sendAsButton: SendAsButton { duration: 150; } -reactionBottomPadding: margins(5px, 2px, 7px, 2px); -reactionBottomSize: 16px; -reactionBottomImage: 28px; -reactionBottomSkip: 3px; -reactionBottomBetween: 4px; -reactionBottomInBubbleLeft: -3px; +reactionInlinePadding: margins(5px, 2px, 7px, 2px); +reactionInlineSize: 16px; +reactionInlineImage: 28px; +reactionInlineSkip: 3px; +reactionInlineBetween: 4px; +reactionInlineInBubbleLeft: -3px; reactionInfoSize: 15px; reactionInfoImage: 30px;