diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-11 14:18:51 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-11 14:26:37 +0200 |
commit | f475fa3f54c3cddba551cbae3a04414c0ee8b5c9 (patch) | |
tree | 6ca1107c42a9e6f1f469d725b5372762098d365b /Libraries/LibVT | |
parent | cf429a788c5c1c8487aad471213650235a396bbc (diff) | |
download | serenity-f475fa3f54c3cddba551cbae3a04414c0ee8b5c9.zip |
LibVT: Show an I-beam cursor over TerminalWidget
..and implement this using the new widget override cursor mechanism.
Diffstat (limited to 'Libraries/LibVT')
-rw-r--r-- | Libraries/LibVT/TerminalWidget.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Libraries/LibVT/TerminalWidget.cpp b/Libraries/LibVT/TerminalWidget.cpp index e45d538f9b..ba13e61037 100644 --- a/Libraries/LibVT/TerminalWidget.cpp +++ b/Libraries/LibVT/TerminalWidget.cpp @@ -94,6 +94,8 @@ TerminalWidget::TerminalWidget(int ptm_fd, bool automatic_size_policy, RefPtr<Co , m_automatic_size_policy(automatic_size_policy) , m_config(move(config)) { + set_override_cursor(Gfx::StandardCursor::IBeam); + set_accepts_emoji_input(true); set_pty_master_fd(ptm_fd); m_cursor_blink_timer = add<Core::Timer>(); @@ -629,9 +631,9 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event) m_hovered_href = {}; } if (!m_hovered_href.is_empty()) - window()->set_cursor(Gfx::StandardCursor::Hand); + set_override_cursor(Gfx::StandardCursor::Hand); else - window()->set_cursor(Gfx::StandardCursor::None); + set_override_cursor(Gfx::StandardCursor::IBeam); update(); } @@ -667,7 +669,6 @@ void TerminalWidget::mousemove_event(GUI::MouseEvent& event) void TerminalWidget::leave_event(Core::Event&) { - window()->set_cursor(Gfx::StandardCursor::None); bool should_update = !m_hovered_href.is_empty(); m_hovered_href = {}; m_hovered_href_id = {}; |