diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-01-11 20:00:46 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-01-12 11:25:51 +0100 |
commit | e181b1cb820a69d92b77f74aeaee62961107f8a2 (patch) | |
tree | a7c874c2201f3dfb442a4f71ab26bf96ca933b48 /Userland/Applications/PixelPaint | |
parent | 6edc0cf5ab2fce211318b5d4f83e319897b621e5 (diff) | |
download | serenity-e181b1cb820a69d92b77f74aeaee62961107f8a2.zip |
Userland: Use Core::Timer::create_foo() factory functions where possible
Diffstat (limited to 'Userland/Applications/PixelPaint')
-rw-r--r-- | Userland/Applications/PixelPaint/Tools/SprayTool.cpp | 6 | ||||
-rw-r--r-- | Userland/Applications/PixelPaint/Tools/TextTool.cpp | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/Userland/Applications/PixelPaint/Tools/SprayTool.cpp b/Userland/Applications/PixelPaint/Tools/SprayTool.cpp index a28bc03137..c1cf9f661b 100644 --- a/Userland/Applications/PixelPaint/Tools/SprayTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/SprayTool.cpp @@ -22,11 +22,9 @@ namespace PixelPaint { SprayTool::SprayTool() { - m_timer = Core::Timer::construct(); - m_timer->on_timeout = [&]() { + m_timer = Core::Timer::create_repeating(200, [&]() { paint_it(); - }; - m_timer->set_interval(200); + }).release_value_but_fixme_should_propagate_errors(); } static double nrand() diff --git a/Userland/Applications/PixelPaint/Tools/TextTool.cpp b/Userland/Applications/PixelPaint/Tools/TextTool.cpp index b2d579bddd..f825ce224a 100644 --- a/Userland/Applications/PixelPaint/Tools/TextTool.cpp +++ b/Userland/Applications/PixelPaint/Tools/TextTool.cpp @@ -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() |