From ee584c5fdd1d7dc0394d1e4d9effd7780086e290 Mon Sep 17 00:00:00 2001 From: dangooddd Date: Wed, 13 Nov 2024 09:49:48 +0300 Subject: [PATCH] Add option to change cursor shape on exit of ScreenInteractive loop --- include/ftxui/component/screen_interactive.hpp | 2 ++ src/ftxui/component/screen_interactive.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/ftxui/component/screen_interactive.hpp b/include/ftxui/component/screen_interactive.hpp index 6c79913..9238e26 100644 --- a/include/ftxui/component/screen_interactive.hpp +++ b/include/ftxui/component/screen_interactive.hpp @@ -39,6 +39,8 @@ class ScreenInteractive : public Screen { // Options. Must be called before Loop(). void TrackMouse(bool enable = true); + void SetCursorReset(Screen::Cursor::Shape shape); + // Return the currently active screen, nullptr if none. static ScreenInteractive* Active(); diff --git a/src/ftxui/component/screen_interactive.cpp b/src/ftxui/component/screen_interactive.cpp index b5643ed..5248fde 100644 --- a/src/ftxui/component/screen_interactive.cpp +++ b/src/ftxui/component/screen_interactive.cpp @@ -441,6 +441,11 @@ void ScreenInteractive::TrackMouse(bool enable) { track_mouse_ = enable; } +/// @brief Set cursor shape on exit of main loop +void ScreenInteractive::SetCursorReset(Screen::Cursor::Shape shape) { + cursor_reset_shape_ = shape; +} + /// @brief Add a task to the main loop. /// It will be executed later, after every other scheduled tasks. /// @ingroup component