Added extra space to choosing sticker animation in left position.
This commit is contained in:
parent
a5be9d78d8
commit
fa4b7145f5
|
@ -309,7 +309,7 @@ bool SendActionPainter::updateNeedsAnimating(crl::time now, bool force) {
|
||||||
// FontData::spacew for more precise calculation.
|
// FontData::spacew for more precise calculation.
|
||||||
const auto mf = QFontMetricsF(_st.font->f);
|
const auto mf = QFontMetricsF(_st.font->f);
|
||||||
_spacesCount = std::round(
|
_spacesCount = std::round(
|
||||||
_sendActionAnimation.width()
|
_sendActionAnimation.widthNoMargins()
|
||||||
/ mf.horizontalAdvance(' '));
|
/ mf.horizontalAdvance(' '));
|
||||||
}
|
}
|
||||||
newTypingString = newTypingString.replace(
|
newTypingString = newTypingString.replace(
|
||||||
|
|
|
@ -38,6 +38,9 @@ public:
|
||||||
bool supports(Type type) const;
|
bool supports(Type type) const;
|
||||||
|
|
||||||
virtual int width() const = 0;
|
virtual int width() const = 0;
|
||||||
|
virtual int widthNoMargins() const {
|
||||||
|
return width();
|
||||||
|
}
|
||||||
virtual void paint(
|
virtual void paint(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
style::color color,
|
style::color color,
|
||||||
|
@ -520,6 +523,10 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
int width() const override {
|
int width() const override {
|
||||||
|
return widthNoMargins() + _eye.step * 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
int widthNoMargins() const override {
|
||||||
return st::historySendActionChooseStickerPosition.x()
|
return st::historySendActionChooseStickerPosition.x()
|
||||||
+ 2 * (_eye.outWidth + _eye.step)
|
+ 2 * (_eye.outWidth + _eye.step)
|
||||||
+ _eye.step;
|
+ _eye.step;
|
||||||
|
@ -681,6 +688,10 @@ int SendActionAnimation::width() const {
|
||||||
return _impl ? _impl->width() : 0;
|
return _impl ? _impl->width() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SendActionAnimation::widthNoMargins() const {
|
||||||
|
return _impl ? _impl->widthNoMargins() : 0;
|
||||||
|
}
|
||||||
|
|
||||||
void SendActionAnimation::paint(
|
void SendActionAnimation::paint(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
style::color color,
|
style::color color,
|
||||||
|
|
|
@ -25,6 +25,7 @@ public:
|
||||||
void tryToFinish();
|
void tryToFinish();
|
||||||
|
|
||||||
int width() const;
|
int width() const;
|
||||||
|
int widthNoMargins() const;
|
||||||
void paint(
|
void paint(
|
||||||
Painter &p,
|
Painter &p,
|
||||||
style::color color,
|
style::color color,
|
||||||
|
|
Loading…
Reference in New Issue