mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 21:15:14 +00:00
HackStudio: Make use of existing TextEditor::on_focusin callback
This commit is contained in:
parent
5aab31dc40
commit
4c551bfad9
Notes:
sideshowbarker
2024-07-17 06:51:10 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/4c551bfad9 Pull-request: https://github.com/SerenityOS/serenity/pull/20105 Reviewed-by: https://github.com/linusg
3 changed files with 1 additions and 16 deletions
|
@ -146,18 +146,6 @@ EditorWrapper const& Editor::wrapper() const
|
|||
return static_cast<EditorWrapper const&>(*parent());
|
||||
}
|
||||
|
||||
void Editor::focusin_event(GUI::FocusEvent& event)
|
||||
{
|
||||
if (on_focus)
|
||||
on_focus();
|
||||
GUI::TextEditor::focusin_event(event);
|
||||
}
|
||||
|
||||
void Editor::focusout_event(GUI::FocusEvent& event)
|
||||
{
|
||||
GUI::TextEditor::focusout_event(event);
|
||||
}
|
||||
|
||||
Gfx::IntRect Editor::gutter_icon_rect(size_t line_number) const
|
||||
{
|
||||
return gutter_content_rect(line_number).translated(frame_thickness(), 0);
|
||||
|
|
|
@ -28,7 +28,6 @@ public:
|
|||
|
||||
virtual ~Editor() override = default;
|
||||
|
||||
Function<void()> on_focus;
|
||||
Function<void(DeprecatedString)> on_open;
|
||||
|
||||
EditorWrapper& wrapper();
|
||||
|
@ -64,8 +63,6 @@ public:
|
|||
void set_semantic_syntax_highlighting(bool value);
|
||||
|
||||
private:
|
||||
virtual void focusin_event(GUI::FocusEvent&) override;
|
||||
virtual void focusout_event(GUI::FocusEvent&) override;
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
virtual void mousemove_event(GUI::MouseEvent&) override;
|
||||
virtual void mousedown_event(GUI::MouseEvent&) override;
|
||||
|
|
|
@ -30,7 +30,7 @@ EditorWrapper::EditorWrapper()
|
|||
m_editor->set_ruler_visible(true);
|
||||
m_editor->set_automatic_indentation_enabled(true);
|
||||
|
||||
m_editor->on_focus = [this] {
|
||||
m_editor->on_focusin = [this] {
|
||||
set_current_editor_wrapper(this);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue