mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
HackStudio: Fix the wrong cursor being drawn
This commit is contained in:
parent
0e04e2cff0
commit
792a709765
2 changed files with 18 additions and 2 deletions
|
@ -93,9 +93,10 @@ void Editor::paint_event(GUI::PaintEvent& event)
|
||||||
if (horizontal_scrollbar().is_visible())
|
if (horizontal_scrollbar().is_visible())
|
||||||
rect.set_height(rect.height() - horizontal_scrollbar().height());
|
rect.set_height(rect.height() - horizontal_scrollbar().height());
|
||||||
painter.draw_rect(rect, palette().selection());
|
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()
|
static HashMap<String, String>& man_paths()
|
||||||
|
@ -283,6 +284,18 @@ void Editor::keyup_event(GUI::KeyEvent& event)
|
||||||
GUI::TextEditor::keyup_event(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>& include_paths()
|
||||||
{
|
{
|
||||||
static HashMap<String, String> paths;
|
static HashMap<String, String> paths;
|
||||||
|
|
|
@ -50,6 +50,8 @@ private:
|
||||||
virtual void mousedown_event(GUI::MouseEvent&) override;
|
virtual void mousedown_event(GUI::MouseEvent&) override;
|
||||||
virtual void keydown_event(GUI::KeyEvent&) override;
|
virtual void keydown_event(GUI::KeyEvent&) override;
|
||||||
virtual void keyup_event(GUI::KeyEvent&) override;
|
virtual void keyup_event(GUI::KeyEvent&) override;
|
||||||
|
virtual void enter_event(Core::Event&) override;
|
||||||
|
virtual void leave_event(Core::Event&) override;
|
||||||
|
|
||||||
void show_documentation_tooltip_if_available(const String&, const Gfx::Point& screen_location);
|
void show_documentation_tooltip_if_available(const String&, const Gfx::Point& screen_location);
|
||||||
void navigate_to_include_if_available(String);
|
void navigate_to_include_if_available(String);
|
||||||
|
@ -60,6 +62,7 @@ private:
|
||||||
RefPtr<Web::HtmlView> m_documentation_html_view;
|
RefPtr<Web::HtmlView> m_documentation_html_view;
|
||||||
String m_last_parsed_token;
|
String m_last_parsed_token;
|
||||||
GUI::TextPosition m_previous_text_position { 0, 0 };
|
GUI::TextPosition m_previous_text_position { 0, 0 };
|
||||||
|
bool m_hovering_editor { false };
|
||||||
bool m_hovering_link { false };
|
bool m_hovering_link { false };
|
||||||
bool m_holding_ctrl { false };
|
bool m_holding_ctrl { false };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue