mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
add Notification::Cancel
This commit is contained in:
parent
ff8de4eec6
commit
cd5a66c1d1
2 changed files with 14 additions and 0 deletions
|
@ -93,5 +93,11 @@ namespace geode {
|
||||||
* to prematurily hide the notification
|
* to prematurily hide the notification
|
||||||
*/
|
*/
|
||||||
void hide();
|
void hide();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cancels the showing of the notification if it's in the queue.
|
||||||
|
* Otherwise, it hides the notification if it's currently showing.
|
||||||
|
*/
|
||||||
|
void cancel();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,3 +211,11 @@ void Notification::hide() {
|
||||||
nullptr
|
nullptr
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Notification::cancel() {
|
||||||
|
if(m_pParent) return this->hide();
|
||||||
|
|
||||||
|
if (s_queue->containsObject(this)) {
|
||||||
|
s_queue->removeObject(this);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue