mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 09:46:04 -05:00
HackStudio: Fix the wrong cursor being drawn
This commit is contained in:
parent
0e04e2cff0
commit
792a709765
Notes:
sideshowbarker
2024-07-19 08:19:47 +09:00
Author: https://github.com/oriko1010 Commit: https://github.com/SerenityOS/serenity/commit/792a7097654 Pull-request: https://github.com/SerenityOS/serenity/pull/1438
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())
|
||||
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;
|
||||
|
|
|
@ -50,6 +50,8 @@ private:
|
|||
virtual void mousedown_event(GUI::MouseEvent&) override;
|
||||
virtual void keydown_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 navigate_to_include_if_available(String);
|
||||
|
@ -60,6 +62,7 @@ private:
|
|||
RefPtr<Web::HtmlView> m_documentation_html_view;
|
||||
String m_last_parsed_token;
|
||||
GUI::TextPosition m_previous_text_position { 0, 0 };
|
||||
bool m_hovering_editor { false };
|
||||
bool m_hovering_link { false };
|
||||
bool m_holding_ctrl { false };
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue