diff options
-rw-r--r-- | Userland/Libraries/LibGUI/TextEditor.cpp | 12 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/TextEditor.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 1d7fd1b251..cf2d80c8e9 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -28,6 +28,7 @@ #include <LibGfx/Font/Font.h> #include <LibGfx/Font/FontDatabase.h> #include <LibGfx/Palette.h> +#include <LibGfx/StandardCursor.h> #include <LibSyntax/Highlighter.h> #include <fcntl.h> #include <stdio.h> @@ -310,6 +311,12 @@ void TextEditor::mousemove_event(MouseEvent& event) update(); return; } + + if (m_ruler_visible && (ruler_rect_in_inner_coordinates().contains(event.position()))) { + set_override_cursor(Gfx::StandardCursor::None); + } else { + set_editing_cursor(); + } } void TextEditor::select_current_line() @@ -1672,6 +1679,11 @@ void TextEditor::set_mode(const Mode mode) VERIFY_NOT_REACHED(); } + set_editing_cursor(); +} + +void TextEditor::set_editing_cursor() +{ if (!is_displayonly()) set_override_cursor(Gfx::StandardCursor::IBeam); else diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h index 547ac759a3..fb1721f05c 100644 --- a/Userland/Libraries/LibGUI/TextEditor.h +++ b/Userland/Libraries/LibGUI/TextEditor.h @@ -95,6 +95,8 @@ public: bool is_displayonly() const { return m_mode == DisplayOnly; } void set_mode(const Mode); + void set_editing_cursor(); + bool is_ruler_visible() const { return m_ruler_visible; } void set_ruler_visible(bool); |