diff options
author | Michaล Lach <m.lach2003@gmail.com> | 2022-05-12 22:52:14 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-06-22 12:12:00 +0100 |
commit | e2b0f6795faf72f187b484ef2b5bd5df6c3461e9 (patch) | |
tree | b70cb56f0d346af764d0a9d31a0bb4c0670eba5c /Userland/Libraries/LibVT/TerminalWidget.h | |
parent | 1950e79d484a4bb7a629aca7add1b0d4896b1ea4 (diff) | |
download | serenity-e2b0f6795faf72f187b484ef2b5bd5df6c3461e9.zip |
LibVT+Kernel: Separate the caret shapes and its steadiness
Currently CursorStyle enum handles both the styles and the steadiness or
blinking of the terminal caret, which doubles the amount of its entries.
This commit changes CursorStyle to CursorShape and moves the blinking
option to a seperate boolean value.
Diffstat (limited to 'Userland/Libraries/LibVT/TerminalWidget.h')
-rw-r--r-- | Userland/Libraries/LibVT/TerminalWidget.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Userland/Libraries/LibVT/TerminalWidget.h b/Userland/Libraries/LibVT/TerminalWidget.h index 99f3a85226..63de6617f6 100644 --- a/Userland/Libraries/LibVT/TerminalWidget.h +++ b/Userland/Libraries/LibVT/TerminalWidget.h @@ -96,6 +96,13 @@ public: void set_color_scheme(StringView); + VT::CursorShape cursor_shape() { return m_cursor_shape; } + virtual void set_cursor_blinking(bool) override; + virtual void set_cursor_shape(CursorShape) override; + + static Optional<VT::CursorShape> parse_cursor_shape(StringView); + static String stringify_cursor_shape(VT::CursorShape); + private: TerminalWidget(int ptm_fd, bool automatic_size_policy); @@ -124,7 +131,6 @@ private: virtual void terminal_did_resize(u16 columns, u16 rows) override; virtual void terminal_history_changed(int delta) override; virtual void emit(u8 const*, size_t) override; - virtual void set_cursor_style(CursorStyle) override; // ^GUI::Clipboard::ClipboardClient virtual void clipboard_content_did_change(String const&) override { update_paste_action(); } @@ -196,7 +202,8 @@ private: bool m_cursor_blink_state { true }; bool m_automatic_size_policy { false }; - VT::CursorStyle m_cursor_style { BlinkingBlock }; + VT::CursorShape m_cursor_shape { VT::CursorShape::Block }; + bool m_cursor_is_blinking_set { true }; enum class AutoScrollDirection { None, |