mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 21:18:14 +00:00
LibGUI: Allow autocomplete to stay open after applying
Previously the autocomplete box would always close after applying a suggestion. This is the desired behavior in almost all cases, but there are some situations (like autocompleting paths) where it would be nicer to keep the autocomplete box open after applying the suggestion.
This commit is contained in:
parent
352f593958
commit
d5baf1c1fa
4 changed files with 33 additions and 8 deletions
|
@ -22,6 +22,7 @@ inline bool encode(IPC::Encoder& encoder, const GUI::AutocompleteProvider::Entry
|
|||
encoder << (u64)response.partial_input_length;
|
||||
encoder << (u32)response.language;
|
||||
encoder << response.display_text;
|
||||
encoder << (u32)response.hide_autocomplete_after_applying;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -30,14 +31,17 @@ inline bool decode(IPC::Decoder& decoder, GUI::AutocompleteProvider::Entry& resp
|
|||
{
|
||||
u32 language = 0;
|
||||
u64 partial_input_length = 0;
|
||||
u32 hide_autocomplete_after_applying = 0;
|
||||
bool ok = decoder.decode(response.completion)
|
||||
&& decoder.decode(partial_input_length)
|
||||
&& decoder.decode(language)
|
||||
&& decoder.decode(response.display_text);
|
||||
&& decoder.decode(response.display_text)
|
||||
&& decoder.decode(hide_autocomplete_after_applying);
|
||||
|
||||
if (ok) {
|
||||
response.language = static_cast<GUI::AutocompleteProvider::Language>(language);
|
||||
response.partial_input_length = partial_input_length;
|
||||
response.hide_autocomplete_after_applying = static_cast<GUI::AutocompleteProvider::Entry::HideAutocompleteAfterApplying>(hide_autocomplete_after_applying);
|
||||
}
|
||||
|
||||
return ok;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue