Returned finish of animating to menu.
This commit is contained in:
parent
5e37c06a6a
commit
79146e54b9
7 changed files with 24 additions and 0 deletions
|
|
@ -79,6 +79,10 @@ RippleButton::RippleButton(QWidget *parent, const style::RippleAnimation &st)
|
||||||
|
|
||||||
void RippleButton::clearState() {
|
void RippleButton::clearState() {
|
||||||
AbstractButton::clearState();
|
AbstractButton::clearState();
|
||||||
|
finishAnimating();
|
||||||
|
}
|
||||||
|
|
||||||
|
void RippleButton::finishAnimating() {
|
||||||
if (_ripple) {
|
if (_ripple) {
|
||||||
_ripple.reset();
|
_ripple.reset();
|
||||||
update();
|
update();
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,8 @@ public:
|
||||||
|
|
||||||
void paintRipple(QPainter &p, int x, int y, const QColor *colorOverride = nullptr);
|
void paintRipple(QPainter &p, int x, int y, const QColor *colorOverride = nullptr);
|
||||||
|
|
||||||
|
void finishAnimating();
|
||||||
|
|
||||||
~RippleButton();
|
~RippleButton();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -168,6 +168,9 @@ void Menu::clearActions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Menu::finishAnimating() {
|
void Menu::finishAnimating() {
|
||||||
|
for (const auto &widget : _actionWidgets) {
|
||||||
|
widget->finishAnimating();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Menu::empty() const {
|
bool Menu::empty() const {
|
||||||
|
|
|
||||||
|
|
@ -111,4 +111,8 @@ void ItemBase::setContentWidth(int w) {
|
||||||
_contentWidth = w;
|
_contentWidth = w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ItemBase::finishAnimating() {
|
||||||
|
RippleButton::finishAnimating();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Ui::Menu
|
} // namespace Ui::Menu
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,8 @@ public:
|
||||||
virtual QAction *action() const = 0;
|
virtual QAction *action() const = 0;
|
||||||
virtual bool isEnabled() const = 0;
|
virtual bool isEnabled() const = 0;
|
||||||
|
|
||||||
|
virtual void finishAnimating();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void init();
|
void init();
|
||||||
void initResizeHook(rpl::producer<QSize> &&size);
|
void initResizeHook(rpl::producer<QSize> &&size);
|
||||||
|
|
|
||||||
|
|
@ -67,4 +67,11 @@ void Toggle::paintEvent(QPaintEvent *e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Toggle::finishAnimating() {
|
||||||
|
ItemBase::finishAnimating();
|
||||||
|
if (_toggle) {
|
||||||
|
_toggle->finishAnimating();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Ui::Menu
|
} // namespace Ui::Menu
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,8 @@ public:
|
||||||
const style::icon *icon,
|
const style::icon *icon,
|
||||||
const style::icon *iconOver);
|
const style::icon *iconOver);
|
||||||
|
|
||||||
|
void finishAnimating() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paintEvent(QPaintEvent *e) override;
|
void paintEvent(QPaintEvent *e) override;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue