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:
@@ -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(),
|
||||
|
@@ -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(
|
||||
|
@@ -39,6 +39,7 @@ public:
|
||||
crl::time ms,
|
||||
bool displayUnreadInfo);
|
||||
static QRect sendActionAnimationRect(
|
||||
int animationLeft,
|
||||
int animationWidth,
|
||||
int animationHeight,
|
||||
int fullWidth,
|
||||
|
Reference in New Issue
Block a user