mirror of https://github.com/procxx/kepka.git
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) {
|
void HistoryTopBarWidget::setHistoryPeer(PeerData *historyPeer) {
|
||||||
if (_historyPeer != historyPeer) {
|
if (_historyPeer != historyPeer) {
|
||||||
_historyPeer = historyPeer;
|
_historyPeer = historyPeer;
|
||||||
|
_back->clearState();
|
||||||
update();
|
update();
|
||||||
|
|
||||||
updateUnreadBadge();
|
updateUnreadBadge();
|
||||||
|
|
|
@ -37,7 +37,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDisabled(bool disabled = true);
|
void setDisabled(bool disabled = true);
|
||||||
void clearState();
|
virtual void clearState();
|
||||||
bool isOver() const {
|
bool isOver() const {
|
||||||
return _state & StateFlag::Over;
|
return _state & StateFlag::Over;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,10 +63,19 @@ void LinkButton::onStateChanged(State was, StateChangeSource source) {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
RippleButton::RippleButton(QWidget *parent, const style::RippleAnimation &st) : AbstractButton(parent)
|
RippleButton::RippleButton(QWidget *parent, const style::RippleAnimation &st)
|
||||||
|
: AbstractButton(parent)
|
||||||
, _st(st) {
|
, _st(st) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RippleButton::clearState() {
|
||||||
|
AbstractButton::clearState();
|
||||||
|
if (_ripple) {
|
||||||
|
_ripple.reset();
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void RippleButton::setForceRippled(
|
void RippleButton::setForceRippled(
|
||||||
bool rippled,
|
bool rippled,
|
||||||
anim::type animated) {
|
anim::type animated) {
|
||||||
|
@ -134,10 +143,6 @@ QPoint RippleButton::prepareRippleStartPosition() const {
|
||||||
return mapFromGlobal(QCursor::pos());
|
return mapFromGlobal(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RippleButton::resetRipples() {
|
|
||||||
_ripple.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
RippleButton::~RippleButton() = default;
|
RippleButton::~RippleButton() = default;
|
||||||
|
|
||||||
FlatButton::FlatButton(QWidget *parent, const QString &text, const style::FlatButton &st) : RippleButton(parent, st.ripple)
|
FlatButton::FlatButton(QWidget *parent, const QString &text, const style::FlatButton &st) : RippleButton(parent, st.ripple)
|
||||||
|
|
|
@ -65,6 +65,8 @@ public:
|
||||||
return QPoint(-0x3FFFFFFF, -0x3FFFFFFF);
|
return QPoint(-0x3FFFFFFF, -0x3FFFFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearState() override;
|
||||||
|
|
||||||
~RippleButton();
|
~RippleButton();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -74,7 +76,6 @@ protected:
|
||||||
|
|
||||||
virtual QImage prepareRippleMask() const;
|
virtual QImage prepareRippleMask() const;
|
||||||
virtual QPoint prepareRippleStartPosition() const;
|
virtual QPoint prepareRippleStartPosition() const;
|
||||||
void resetRipples();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ensureRipple();
|
void ensureRipple();
|
||||||
|
|
Loading…
Reference in New Issue