mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-25 04:38:23 +00:00
Fix ripple animation glitch in history top bar.
This commit is contained in:
parent
46bafc2dcc
commit
f8e094392f
@ -380,6 +380,7 @@ void HistoryTopBarWidget::backClicked() {
|
||||
void HistoryTopBarWidget::setHistoryPeer(PeerData *historyPeer) {
|
||||
if (_historyPeer != historyPeer) {
|
||||
_historyPeer = historyPeer;
|
||||
_back->clearState();
|
||||
update();
|
||||
|
||||
updateUnreadBadge();
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
}
|
||||
|
||||
void setDisabled(bool disabled = true);
|
||||
void clearState();
|
||||
virtual void clearState();
|
||||
bool isOver() const {
|
||||
return _state & StateFlag::Over;
|
||||
}
|
||||
|
@ -63,10 +63,19 @@ void LinkButton::onStateChanged(State was, StateChangeSource source) {
|
||||
update();
|
||||
}
|
||||
|
||||
RippleButton::RippleButton(QWidget *parent, const style::RippleAnimation &st) : AbstractButton(parent)
|
||||
RippleButton::RippleButton(QWidget *parent, const style::RippleAnimation &st)
|
||||
: AbstractButton(parent)
|
||||
, _st(st) {
|
||||
}
|
||||
|
||||
void RippleButton::clearState() {
|
||||
AbstractButton::clearState();
|
||||
if (_ripple) {
|
||||
_ripple.reset();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void RippleButton::setForceRippled(
|
||||
bool rippled,
|
||||
anim::type animated) {
|
||||
@ -134,10 +143,6 @@ QPoint RippleButton::prepareRippleStartPosition() const {
|
||||
return mapFromGlobal(QCursor::pos());
|
||||
}
|
||||
|
||||
void RippleButton::resetRipples() {
|
||||
_ripple.reset();
|
||||
}
|
||||
|
||||
RippleButton::~RippleButton() = default;
|
||||
|
||||
FlatButton::FlatButton(QWidget *parent, const QString &text, const style::FlatButton &st) : RippleButton(parent, st.ripple)
|
||||
|
@ -65,6 +65,8 @@ public:
|
||||
return QPoint(-0x3FFFFFFF, -0x3FFFFFFF);
|
||||
}
|
||||
|
||||
void clearState() override;
|
||||
|
||||
~RippleButton();
|
||||
|
||||
protected:
|
||||
@ -74,7 +76,6 @@ protected:
|
||||
|
||||
virtual QImage prepareRippleMask() const;
|
||||
virtual QPoint prepareRippleStartPosition() const;
|
||||
void resetRipples();
|
||||
|
||||
private:
|
||||
void ensureRipple();
|
||||
|
Loading…
Reference in New Issue
Block a user