2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Closed beta 10020005: Added several buttons animations.

This commit is contained in:
John Preston
2016-12-27 02:46:36 +04:00
parent ef927c8465
commit 38e6a0ae7e
19 changed files with 445 additions and 227 deletions

View File

@@ -131,6 +131,10 @@ 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)
@@ -189,7 +193,6 @@ void FlatButton::paintEvent(QPaintEvent *e) {
RoundButton::RoundButton(QWidget *parent, const QString &text, const style::RoundButton &st) : RippleButton(parent, st.ripple)
, _fullText(text)
, _st(st) {
setCursor(style::cur_pointer);
updateText();
}
@@ -308,7 +311,6 @@ QPoint RoundButton::prepareRippleStartPosition() const {
IconButton::IconButton(QWidget *parent, const style::IconButton &st) : RippleButton(parent, st.ripple)
, _st(st) {
resize(_st.width, _st.height);
setCursor(style::cur_pointer);
}
void IconButton::setIconOverride(const style::icon *iconOverride, const style::icon *iconOverOverride) {

View File

@@ -75,6 +75,7 @@ protected:
QPoint disabledRippleStartPosition() const {
return QPoint(-0x3FFFFFFF, -0x3FFFFFFF);
}
void resetRipples();
private:
void ensureRipple();