1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

HackStudio: Fix the wrong cursor being drawn

This commit is contained in:
Oriko 2020-03-13 15:33:49 +02:00 committed by Andreas Kling
parent 0e04e2cff0
commit 792a709765
2 changed files with 18 additions and 2 deletions

View file

@ -93,9 +93,10 @@ void Editor::paint_event(GUI::PaintEvent& event)
if (horizontal_scrollbar().is_visible())
rect.set_height(rect.height() - horizontal_scrollbar().height());
painter.draw_rect(rect, palette().selection());
window()->set_override_cursor(m_hovering_link && m_holding_ctrl ? GUI::StandardCursor::Hand : GUI::StandardCursor::IBeam);
}
if (m_hovering_editor)
window()->set_override_cursor(m_hovering_link && m_holding_ctrl ? GUI::StandardCursor::Hand : GUI::StandardCursor::IBeam);
}
static HashMap<String, String>& man_paths()
@ -283,6 +284,18 @@ void Editor::keyup_event(GUI::KeyEvent& event)
GUI::TextEditor::keyup_event(event);
}
void Editor::enter_event(Core::Event& event)
{
m_hovering_editor = true;
GUI::TextEditor::enter_event(event);
}
void Editor::leave_event(Core::Event& event)
{
m_hovering_editor = false;
GUI::TextEditor::leave_event(event);
}
static HashMap<String, String>& include_paths()
{
static HashMap<String, String> paths;