1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibGUI: Disable EmojiInputDialog updates while re-displaying emoji

To prevent lag when the displayed code points are redrawn in support of
a search box, disable updates while re-adding the emoji buttons.
This commit is contained in:
Timothy Flynn 2022-09-06 10:33:18 -04:00 committed by Linus Groh
parent 1c32823dd8
commit a885406511

View file

@ -6,6 +6,7 @@
*/
#include <AK/LexicalPath.h>
#include <AK/ScopeGuard.h>
#include <AK/StringBuilder.h>
#include <AK/Utf32View.h>
#include <LibCore/DirIterator.h>
@ -89,6 +90,9 @@ auto EmojiInputDialog::supported_emoji() -> Vector<Emoji>
void EmojiInputDialog::update_displayed_emoji()
{
ScopeGuard guard { [&] { m_emojis_widget->set_updates_enabled(true); } };
m_emojis_widget->set_updates_enabled(false);
constexpr size_t columns = 18;
size_t rows = ceil_div(m_emojis.size(), columns);
size_t index = 0;