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() {
|
||||
AbstractButton::clearState();
|
||||
finishAnimating();
|
||||
}
|
||||
|
||||
void RippleButton::finishAnimating() {
|
||||
if (_ripple) {
|
||||
_ripple.reset();
|
||||
update();
|
||||
|
|
|
|||
|
|
@ -60,6 +60,8 @@ public:
|
|||
|
||||
void paintRipple(QPainter &p, int x, int y, const QColor *colorOverride = nullptr);
|
||||
|
||||
void finishAnimating();
|
||||
|
||||
~RippleButton();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -168,6 +168,9 @@ void Menu::clearActions() {
|
|||
}
|
||||
|
||||
void Menu::finishAnimating() {
|
||||
for (const auto &widget : _actionWidgets) {
|
||||
widget->finishAnimating();
|
||||
}
|
||||
}
|
||||
|
||||
bool Menu::empty() const {
|
||||
|
|
|
|||
|
|
@ -111,4 +111,8 @@ void ItemBase::setContentWidth(int w) {
|
|||
_contentWidth = w;
|
||||
}
|
||||
|
||||
void ItemBase::finishAnimating() {
|
||||
RippleButton::finishAnimating();
|
||||
}
|
||||
|
||||
} // namespace Ui::Menu
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public:
|
|||
virtual QAction *action() const = 0;
|
||||
virtual bool isEnabled() const = 0;
|
||||
|
||||
virtual void finishAnimating();
|
||||
|
||||
protected:
|
||||
void init();
|
||||
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
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ public:
|
|||
const style::icon *icon,
|
||||
const style::icon *iconOver);
|
||||
|
||||
void finishAnimating() override;
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e) override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue