1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

LibCore: Add Core::Timer::create_single_shot()

This is just a convenience function for creating single-shot timers.
This commit is contained in:
Andreas Kling 2020-04-07 22:15:22 +02:00
parent f813041f67
commit a53cf81374
4 changed files with 33 additions and 35 deletions

View file

@ -62,12 +62,9 @@ Document::Document()
, m_style_resolver(make<StyleResolver>(*this))
, m_window(Window::create_with_document(*this))
{
m_style_update_timer = Core::Timer::construct();
m_style_update_timer->set_single_shot(true);
m_style_update_timer->set_interval(0);
m_style_update_timer->on_timeout = [this] {
m_style_update_timer = Core::Timer::create_single_shot(0, [this] {
update_style();
};
});
}
Document::~Document()