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/HexEditor/HexEditor.cpp | |
parent | 6edc0cf5ab2fce211318b5d4f83e319897b621e5 (diff) | |
download | serenity-e181b1cb820a69d92b77f74aeaee62961107f8a2.zip |
Userland: Use Core::Timer::create_foo() factory functions where possible
Diffstat (limited to 'Userland/Applications/HexEditor/HexEditor.cpp')
-rw-r--r-- | Userland/Applications/HexEditor/HexEditor.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp index 03d762f603..206f2f1043 100644 --- a/Userland/Applications/HexEditor/HexEditor.cpp +++ b/Userland/Applications/HexEditor/HexEditor.cpp @@ -31,8 +31,7 @@ #include <unistd.h> HexEditor::HexEditor() - : m_blink_timer(Core::Timer::construct()) - , m_document(make<HexDocumentMemory>(ByteBuffer::create_zeroed(0).release_value_but_fixme_should_propagate_errors())) + : m_document(make<HexDocumentMemory>(ByteBuffer::create_zeroed(0).release_value_but_fixme_should_propagate_errors())) { set_should_hide_unnecessary_scrollbars(true); set_focus_policy(GUI::FocusPolicy::StrongFocus); @@ -42,11 +41,10 @@ HexEditor::HexEditor() set_foreground_role(ColorRole::BaseText); vertical_scrollbar().set_step(line_height()); - m_blink_timer->set_interval(500); - m_blink_timer->on_timeout = [this]() { + m_blink_timer = Core::Timer::create_repeating(500, [this]() { m_cursor_blink_active = !m_cursor_blink_active; update(); - }; + }).release_value_but_fixme_should_propagate_errors(); m_blink_timer->start(); } |