1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:37:35 +00:00

Userland: Use Core::Timer::create_foo() factory functions where possible

This commit is contained in:
Sam Atkins 2023-01-11 20:00:46 +00:00 committed by Andreas Kling
parent 6edc0cf5ab
commit e181b1cb82
12 changed files with 37 additions and 51 deletions

View file

@ -36,11 +36,9 @@ TextTool::TextTool()
m_text_editor->set_wrapping_mode(GUI::TextEditor::WrappingMode::NoWrap);
m_selected_font = Gfx::FontDatabase::default_font();
m_text_editor->set_font(m_selected_font);
m_cursor_blink_timer = Core::Timer::construct();
m_cursor_blink_timer->on_timeout = [&]() {
m_cursor_blink_timer = Core::Timer::create_repeating(500, [&]() {
m_cursor_blink_state = !m_cursor_blink_state;
};
m_cursor_blink_timer->set_interval(500);
}).release_value_but_fixme_should_propagate_errors();
}
void TextTool::on_tool_deactivation()