HackStudio: Stop incorrectly overriding gutter cursors

Only adjust the cursor to respond to clickable text, if the mouse is
over text.
This commit is contained in:
Sam Atkins 2024-01-11 14:23:46 +00:00 committed by Sam Atkins
parent e685b0a819
commit 7cf2674061
Notes: sideshowbarker 2024-07-17 00:53:02 +09:00

View File

@ -260,11 +260,7 @@ void Editor::mousemove_event(GUI::MouseEvent& event)
bool hide_tooltip = (m_tooltip_role == TooltipRole::Documentation);
bool is_over_clickable = false;
auto ruler_line_rect = ruler_content_rect(text_position.line());
auto hovering_lines_ruler = (event.position().x() < ruler_line_rect.width());
if (hovering_lines_ruler && !is_in_drag_select())
set_override_cursor(Gfx::StandardCursor::Arrow);
else if (m_hovering_editor)
if (m_hovering_editor && event.position().x() > fixed_elements_width())
set_override_cursor(m_hovering_clickable && event.ctrl() ? Gfx::StandardCursor::Hand : Gfx::StandardCursor::IBeam);
for (auto& span : document().spans()) {
@ -472,8 +468,6 @@ void Editor::set_document(GUI::TextDocument& doc)
VERIFY(is<CodeDocument>(doc));
GUI::TextEditor::set_document(doc);
set_override_cursor(Gfx::StandardCursor::IBeam);
auto& code_document = static_cast<CodeDocument&>(doc);
set_language_client_for(code_document);