2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 14:45:14 +00:00

Added animation of send action for stickers to middle of text.

This commit is contained in:
23rd
2021-08-30 20:38:11 +03:00
parent 8c17e3e578
commit 436212bb88
8 changed files with 93 additions and 9 deletions

View File

@@ -171,6 +171,7 @@ InnerWidget::InnerWidget(
const Data::Session::SendActionAnimationUpdate &update) {
using RowPainter = Layout::RowPainter;
const auto updateRect = RowPainter::sendActionAnimationRect(
update.left,
update.width,
update.height,
width(),

View File

@@ -943,11 +943,24 @@ void RowPainter::paint(
paintCounterCallback);
}
QRect RowPainter::sendActionAnimationRect(int animationWidth, int animationHeight, int fullWidth, bool textUpdated) {
auto nameleft = st::dialogsPadding.x() + st::dialogsPhotoSize + st::dialogsPhotoPadding;
auto namewidth = fullWidth - nameleft - st::dialogsPadding.x();
auto texttop = st::dialogsPadding.y() + st::msgNameFont->height + st::dialogsSkip;
return QRect(nameleft, texttop, textUpdated ? namewidth : animationWidth, animationHeight);
QRect RowPainter::sendActionAnimationRect(
int animationLeft,
int animationWidth,
int animationHeight,
int fullWidth,
bool textUpdated) {
const auto nameleft = st::dialogsPadding.x()
+ st::dialogsPhotoSize
+ st::dialogsPhotoPadding;
const auto namewidth = fullWidth - nameleft - st::dialogsPadding.x();
const auto texttop = st::dialogsPadding.y()
+ st::msgNameFont->height
+ st::dialogsSkip;
return QRect(
nameleft + (textUpdated ? 0 : animationLeft),
texttop,
textUpdated ? namewidth : animationWidth,
animationHeight);
}
void PaintCollapsedRow(

View File

@@ -39,6 +39,7 @@ public:
crl::time ms,
bool displayUnreadInfo);
static QRect sendActionAnimationRect(
int animationLeft,
int animationWidth,
int animationHeight,
int fullWidth,