1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:57:44 +00:00

LibGUI: Hide autocomplete on any event other than typing

Moving the cursor to a different location, by any means, should
dismiss the autocomplete popup. This is the behavior of virtually
every editor/IDE out there, and it is really annoying (and
confusing) when our autocomplete doesn't behave like that.
This commit is contained in:
thislooksfun 2021-10-27 23:39:55 -05:00 committed by Andreas Kling
parent 0627ed9900
commit 86ea41970d
2 changed files with 18 additions and 7 deletions

View file

@ -229,7 +229,7 @@ protected:
virtual void context_menu_event(ContextMenuEvent&) override;
virtual void resize_event(ResizeEvent&) override;
virtual void theme_change_event(ThemeChangeEvent&) override;
virtual void cursor_did_change() { }
virtual void cursor_did_change();
Gfx::IntRect ruler_content_rect(size_t line) const;
Gfx::IntRect gutter_content_rect(size_t line) const;
@ -279,6 +279,7 @@ private:
Yes
};
void try_show_autocomplete(UserRequestedAutocomplete);
void hide_autocomplete_if_needed();
int icon_size() const { return 16; }
int icon_padding() const { return 2; }